Skip to content

Live Demo ​

vue-stack-tabs · live demoOpen in a new window ↗

The demo above is a real Vue 3 application — its own Vue Router, its own tabs, its own page stack — running in an isolated iframe. Use the title bar to open it in a new window.

Why an iframe? ​

vue-stack-tabs binds every tab stack to the browser URL, so running it inside the documentation would fight VitePress for the same router. The demo therefore lives in its own app (docs/.vitepress/demo-app) and is embedded here; open it standalone to watch the URL, the __tab query and the history change as you switch tabs.

What to try ​

  1. Open a tab — click 报表列表 / Reports, then 查看详情 / View detail on a row: you move forward inside the same tab, the tab bar does not grow.
  2. Go back with a result — on the detail page press 后退并回传: the list receives the value through props._back.
  3. Cache isolation — click 打开 3 个报表标签: three tabs point at the same route with different params, each with its own cache.
  4. Form state — open 表单 / Form, type something, switch tabs and come back: your input is still there.
  5. Scroll memory — open 长列表 / Long list, scroll to the middle, switch away and back: the position is restored.
  6. iframe tab — click 打开 iframe 标签: the page inside the iframe can ask the parent to open a new tab via postMessage.
  7. Page loading overlay — click Open the loading demo and run the simulated request: the overlay covers that tab only; switch tabs while it runs and the others stay usable.

What each control covers ​

CapabilityHow to see itAPI
Open / switch / close tabsConsole buttons and right-click menu on the tab baruseTabActions
Tab bar drag & drop reorderingDrag one tab over anothermoveTab
Forward / backward inside a tabReports → detail → back (with _back params)useTabRouter
Independent cache per tabThree report tabs on the same routeper-page keep-alive cache
Form state preservedForm tab, switch away and backkeep-alive caching
Scroll position memoryLong list, switch away and backaddScrollTarget
iframe tabs + postMessage bridgeiframe tab, then its in-page buttonIFrame, postOpenTab
Page loading overlayConsole: Open the loading demo, then simulate a requestuseTabLoading
Refresh single / all tabsConsole: 刷新当前 / 刷新全部refreshTab, refreshAllTabs
Session restoreReload the demo page — previously open tabs come backsessionPrefix, sessionStorage

Released under the Apache License.