vue-multi-router 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +307 -291
  2. package/dist/index.d.ts +20 -20
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -1,291 +1,307 @@
1
- # vue-multi-router
2
-
3
- Vue 3 Multi Router that allows you to have multiple routers in your application.
4
-
5
- [![npm downloads](https://img.shields.io/npm/dm/vue-multi-router.svg)](https://www.npmjs.com/package/vue-multi-router)
6
- [![TypeScript](https://badgen.net/badge/icon/TypeScript?icon=typescript&label)](https://www.typescriptlang.org/)
7
- [![Vue 3](https://img.shields.io/badge/vue-3.x-brightgreen.svg)](https://vuejs.org/)
8
- [![Bundle Size](https://img.shields.io/bundlephobia/minzip/vue-multi-router)](https://bundlephobia.com/package/vue-multi-router)
9
- [![GitHub issues](https://img.shields.io/github/issues/lviobio/vue-multi-router)](https://github.com/lviobio/vue-multi-router/issues)
10
- [![GitHub License](https://img.shields.io/github/license/lviobio/vue-multi-router)](https://github.com/lviobio/vue-multi-router)
11
- ![CI](https://github.com/lviobio/vue-multi-router/actions/workflows/ci.yml/badge.svg)
12
- ![Coverage](https://github.com/lviobio/vue-multi-router/actions/workflows/coverage.yml/badge.svg)
13
- [![codecov](https://codecov.io/gh/lviobio/vue-multi-router/branch/main/graph/badge.svg)](https://codecov.io/gh/lviobio/vue-multi-router)
14
- [![Live Demo](https://img.shields.io/badge/demo-live-brightgreen)](https://lviobio.github.io/vue-multi-router/)
15
-
16
- ## Live Demo
17
-
18
- 🚀 **[Try the interactive playground](https://lviobio.github.io/vue-multi-router)**
19
-
20
- ## Installation
21
-
22
- ```bash
23
- npm install vue-multi-router
24
- ```
25
-
26
- ## Features
27
-
28
- - **Multiple Independent Routers** - Run multiple Vue Router instances simultaneously in a single app
29
- - **Context-Based Navigation** - Each routing context maintains its own navigation history
30
- - **Browser History Integration** - Back/forward buttons work across contexts with proper URL updates
31
- - **Session Persistence** - Context states persist across page reloads via SessionStorage or other implementations
32
- - **TypeScript Support** - Full type definitions included
33
- - **Composable API** - Easy-to-use composables for accessing router state
34
-
35
- ## Basic Usage
36
-
37
- ### 1. Create Multi Router
38
-
39
- ```typescript
40
- // router.ts
41
- import { createMultiRouter } from 'vue-multi-router'
42
- import { createWebHistory } from 'vue-router'
43
-
44
- export const multiRouter = createMultiRouter({
45
- history: () => createWebHistory(),
46
- routes: [
47
- {
48
- path: '/',
49
- component: () => import('./views/Layout.vue'),
50
- children: [
51
- { path: 'home', component: () => import('./views/Home.vue') },
52
- { path: 'about', component: () => import('./views/About.vue') },
53
- ],
54
- },
55
- ],
56
- })
57
- ```
58
-
59
- ### 2. Install Plugin
60
-
61
- ```typescript
62
- // main.ts
63
- import { createApp } from 'vue'
64
- import App from './App.vue'
65
- import { multiRouter } from './router'
66
-
67
- const app = createApp(App)
68
- app.use(multiRouter)
69
- app.mount('#app')
70
- ```
71
-
72
- ### 3. Define Contexts
73
-
74
- ```vue
75
- <!-- App.vue -->
76
- <template>
77
- <MultiRouterContext type="main" name="main" default>
78
- <RouterView />
79
- </MultiRouterContext>
80
- </template>
81
-
82
- <script setup>
83
- import { MultiRouterContext } from 'vue-multi-router'
84
- </script>
85
- ```
86
-
87
- `MultiRouterContext` acts as an activator by default — clicking anywhere inside it activates the context. No extra wrapper needed.
88
-
89
- ### 4. Create Additional Contexts
90
-
91
- ```vue
92
- <!-- Panels.vue -->
93
- <template>
94
- <div v-for="panel in panels" :key="panel.id">
95
- <MultiRouterContext
96
- type="panel"
97
- :name="`panel-${panel.id}`"
98
- initial-location="/home"
99
- >
100
- <RouterView />
101
- </MultiRouterContext>
102
- </div>
103
- </template>
104
- ```
105
-
106
- ## API Reference
107
-
108
- ### `createMultiRouter(options)`
109
-
110
- Creates a multi-router instance.
111
-
112
- **Options:**
113
- - `history: () => RouterHistory` - Factory function returning a Vue Router history instance
114
- - `routes: RouteRecordRaw[]` - Route definitions (same as Vue Router)
115
- - `historyOptions?: MultiRouterHistoryManagerOptions` - History management options
116
-
117
- ### Route Meta Options
118
-
119
- **`multiRouterRoot: boolean`**
120
-
121
- Marks a route as the root for context rendering. When a context navigates to a nested route, `RouterView` inside the context will start rendering from the route marked with `multiRouterRoot: true`, skipping parent routes.
122
-
123
- ```typescript
124
- const routes = [
125
- {
126
- path: '/dashboard',
127
- component: DashboardLayout,
128
- children: [
129
- {
130
- path: 'panels',
131
- component: PanelsContainer,
132
- children: [
133
- {
134
- path: 'content',
135
- component: PanelContent,
136
- meta: { multiRouterRoot: true }, // Context renders from here
137
- },
138
- ],
139
- },
140
- ],
141
- },
142
- ]
143
- ```
144
-
145
- This is useful when contexts are nested inside shared layouts but should render independently from their root component.
146
-
147
- ### `<MultiRouterContext>`
148
-
149
- Component that defines a routing context boundary. By default, it also acts as an activator — clicking inside the context activates it.
150
-
151
- **Props:**
152
- - `type: string` - Context type identifier (for debugging/organization)
153
- - `name: string` - Unique context identifier
154
- - `location?: string` - Force specific location (overrides storage)
155
- - `initial-location?: string` - Initial location for new contexts
156
- - `history-enabled?: boolean` - Whether to track in browser history (default: `true`)
157
- - `default?: boolean` - Activate by default if no saved context exists
158
- - `activator?: boolean` - Whether to activate context on mousedown (default: `true`). Set to `false` to opt out of built-in activation behavior
159
- - `prevent-class?: string` - CSS class that prevents activation on click, useful if you want to prevent activation on click of a button that destroys the context
160
-
161
- To disable the built-in activator:
162
-
163
- ```vue
164
- <MultiRouterContext type="panel" name="panel-1" :activator="false">
165
- <!-- manage activation manually -->
166
- </MultiRouterContext>
167
- ```
168
-
169
- ### `<MultiRouterContextActivator>`
170
-
171
- Standalone wrapper component that activates context on user interaction. Useful for advanced cases where you need fine-grained control over which element triggers activation, separate from the `MultiRouterContext` boundary.
172
-
173
- **Props:**
174
- - `prevent-class?: string` - CSS class that prevents activation on click
175
- - `as?: string` - HTML element to render as wrapper (default: fragment/div)
176
-
177
- ### `useMultiRouter()`
178
-
179
- Composable for accessing multi-router outside a context.
180
-
181
- **Returns:**
182
- - `activeContextKey: ComputedRef<string | undefined>` - Currently active context
183
- - `activeHistoryContextKey: ComputedRef<string | undefined>` - Context controlling browser URL
184
- - `setActive(contextKey: string, updateHistory?: boolean): void` - Activate a context
185
- - `hasContext(contextKey: string): boolean` - Check if context exists
186
-
187
- ### `useMultiRouterContext()`
188
-
189
- Composable for use inside a `MultiRouterContext`.
190
-
191
- **Returns:**
192
- - `manager: useMultiRouter()` - MultiRouter manager instance
193
- - `contextKey: string` - This context's key
194
- - `isActive: ComputedRef<boolean>` - Whether this context is active
195
- - `isHistoryActive: ComputedRef<boolean>` - Whether this context controls browser URL
196
- - `activeContextKey: ComputedRef<string>` - Currently active context key
197
- - `activeHistoryContextKey: ComputedRef<string>` - Currently active history context key
198
- - `historyEnabled: ComputedRef<boolean>` - Whether history is enabled for this context
199
- - `activate(updateHistory?: boolean): void` - Activate this context
200
- - `setActive(contextKey: string, updateHistory?: boolean): void` - Activate a context
201
- - `hasContext(contextKey: string): boolean` - Check if context exists
202
-
203
- ## Examples
204
-
205
- ### Cards with Query Parameters
206
-
207
- ```vue
208
- <template>
209
- <div v-for="card in cards" :key="card.id">
210
- <MultiRouterContext
211
- type="card"
212
- :name="`card-${card.id}`"
213
- initial-location="/card/content"
214
- :history-enabled="false"
215
- >
216
- <CardContent @close="removeCard(card.id)" />
217
- </MultiRouterContext>
218
- </div>
219
- </template>
220
- ```
221
-
222
- ### Accessing Route in Context
223
-
224
- ```vue
225
- <script setup>
226
- import { useRouter, useRoute } from 'vue-router'
227
-
228
- const router = useRouter()
229
- const route = useRoute()
230
-
231
- // Navigate within this context
232
- function goToPage(path) {
233
- router.push(path)
234
- }
235
-
236
- // Access query params
237
- const searchQuery = computed(() => route.query.q)
238
- </script>
239
- ```
240
-
241
- ## Peer Dependencies
242
-
243
- - `vue`: ^3.5.0
244
- - `vue-router`: ^4.0.0
245
-
246
- ## License
247
-
248
- MIT
249
-
250
- ## Development
251
-
252
- ### Running Playground Locally
253
-
254
- ```bash
255
- # Development mode (hot reload)
256
- npm run play
257
-
258
- # Production preview
259
- npm run build:playground
260
- npm run preview:playground
261
- ```
262
-
263
- ### Building
264
-
265
- ```bash
266
- # Build library
267
- npm run build
268
-
269
- # Build playground for deployment
270
- npm run build:playground
271
- ```
272
-
273
- ### Testing & Quality
274
-
275
- ```bash
276
- # Run all checks
277
- npm run check
278
-
279
- # Type checking
280
- npm run ts:check
281
-
282
- # Linting
283
- npm run lint
284
-
285
- # Formatting
286
- npm run format
287
- ```
288
-
289
- ## Contributing
290
-
291
- Contributions are welcome! Please feel free to submit a Pull Request.
1
+ # vue-multi-router
2
+
3
+ Vue 3 Multi Router that allows you to have multiple routers in your application.
4
+
5
+ [![npm downloads](https://img.shields.io/npm/dm/vue-multi-router.svg)](https://www.npmjs.com/package/vue-multi-router)
6
+ [![TypeScript](https://badgen.net/badge/icon/TypeScript?icon=typescript&label)](https://www.typescriptlang.org/)
7
+ [![Vue 3](https://img.shields.io/badge/vue-3.x-brightgreen.svg)](https://vuejs.org/)
8
+ [![Bundle Size](https://img.shields.io/bundlephobia/minzip/vue-multi-router)](https://bundlephobia.com/package/vue-multi-router)
9
+ [![GitHub issues](https://img.shields.io/github/issues/lviobio/vue-multi-router)](https://github.com/lviobio/vue-multi-router/issues)
10
+ [![GitHub License](https://img.shields.io/github/license/lviobio/vue-multi-router)](https://github.com/lviobio/vue-multi-router)
11
+ ![CI](https://github.com/lviobio/vue-multi-router/actions/workflows/ci.yml/badge.svg)
12
+ ![Coverage](https://github.com/lviobio/vue-multi-router/actions/workflows/coverage.yml/badge.svg)
13
+ [![codecov](https://codecov.io/gh/lviobio/vue-multi-router/branch/main/graph/badge.svg)](https://codecov.io/gh/lviobio/vue-multi-router)
14
+ [![Live Demo](https://img.shields.io/badge/demo-live-brightgreen)](https://lviobio.github.io/vue-multi-router/)
15
+
16
+ ## Live Demo
17
+
18
+ 🚀 **[Try the interactive playground](https://lviobio.github.io/vue-multi-router)**
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ npm install vue-multi-router
24
+ ```
25
+
26
+ ## Features
27
+
28
+ - **Multiple Independent Routers** - Run multiple Vue Router instances simultaneously in a single app
29
+ - **Context-Based Navigation** - Each routing context maintains its own navigation history
30
+ - **Browser History Integration** - Back/forward buttons work across contexts with proper URL updates
31
+ - **Session Persistence** - Context states persist across page reloads via SessionStorage or other implementations
32
+ - **TypeScript Support** - Full type definitions included
33
+ - **Composable API** - Easy-to-use composables for accessing router state
34
+
35
+ ## Motivation
36
+
37
+ Vue Router is designed around a single-router-per-app model. That works well for most applications, but falls short when your UI needs **multiple independent navigation areas** — each with its own route, history stack, and back/forward behavior.
38
+
39
+ Think of:
40
+
41
+ - **Dashboard applications** with several panels, each displaying a different page
42
+ - **Desktop-like UIs** with floating or tiled windows that navigate independently
43
+ - **Tabbed interfaces** where each tab has its own browsing history
44
+ - **Multi-pane editors** (email clients, admin tools) with a sidebar, list, and detail view that all route separately
45
+
46
+ Without vue-multi-router you'd have to juggle manual `<component :is>` switching, duplicate router instances with conflicting URL ownership, or complex query-parameter schemes — all of which break browser history and become hard to maintain.
47
+
48
+ vue-multi-router solves this by letting you wrap any part of your template in a `<MultiRouterContext>`. Each context gets its own virtual navigation stack while sharing a single set of route definitions and a single browser URL. The library manages history entries so that the browser back/forward buttons work correctly across every context, and state is persisted through page reloads via SessionStorage.
49
+
50
+ ## Basic Usage
51
+
52
+ ### 1. Create Multi Router
53
+
54
+ ```typescript
55
+ // router.ts
56
+ import { createMultiRouter } from 'vue-multi-router'
57
+ import { createWebHistory } from 'vue-router'
58
+
59
+ export const multiRouter = createMultiRouter({
60
+ history: createWebHistory(),
61
+ routes: [
62
+ {
63
+ path: '/',
64
+ component: () => import('./views/Layout.vue'),
65
+ children: [
66
+ { path: 'home', component: () => import('./views/Home.vue') },
67
+ { path: 'about', component: () => import('./views/About.vue') },
68
+ ],
69
+ },
70
+ ],
71
+ })
72
+ ```
73
+
74
+ ### 2. Install Plugin
75
+
76
+ ```typescript
77
+ // main.ts
78
+ import { createApp } from 'vue'
79
+ import App from './App.vue'
80
+ import { multiRouter } from './router'
81
+
82
+ const app = createApp(App)
83
+ app.use(multiRouter)
84
+ app.mount('#app')
85
+ ```
86
+
87
+ ### 3. Define Contexts
88
+
89
+ ```vue
90
+ <!-- App.vue -->
91
+ <template>
92
+ <MultiRouterContext type="main" name="main" default>
93
+ <RouterView />
94
+ </MultiRouterContext>
95
+ </template>
96
+
97
+ <script setup>
98
+ import { MultiRouterContext } from 'vue-multi-router'
99
+ </script>
100
+ ```
101
+
102
+ `MultiRouterContext` acts as an activator by default — clicking anywhere inside it activates the context. No extra wrapper needed.
103
+
104
+ ### 4. Create Additional Contexts
105
+
106
+ ```vue
107
+ <!-- Panels.vue -->
108
+ <template>
109
+ <div v-for="panel in panels" :key="panel.id">
110
+ <MultiRouterContext type="panel" :name="`panel-${panel.id}`" initial-location="/home">
111
+ <RouterView />
112
+ </MultiRouterContext>
113
+ </div>
114
+ </template>
115
+ ```
116
+
117
+ ## API Reference
118
+
119
+ ### `createMultiRouter(options)`
120
+
121
+ Creates a multi-router instance.
122
+
123
+ **Options:**
124
+
125
+ - `history: RouterHistory` - Vue Router history instance
126
+ - `routes: RouteRecordRaw[]` - Route definitions (same as Vue Router)
127
+ - `historyOptions?: MultiRouterHistoryManagerOptions` - History management options
128
+
129
+ ### Route Meta Options
130
+
131
+ **`multiRouterRoot: boolean`**
132
+
133
+ Marks a route as the root for context rendering. When a context navigates to a nested route, `RouterView` inside the context will start rendering from the route marked with `multiRouterRoot: true`, skipping parent routes.
134
+
135
+ ```typescript
136
+ const routes = [
137
+ {
138
+ path: '/dashboard',
139
+ component: DashboardLayout,
140
+ children: [
141
+ {
142
+ path: 'panels',
143
+ component: PanelsContainer,
144
+ children: [
145
+ {
146
+ path: 'content',
147
+ component: PanelContent,
148
+ meta: { multiRouterRoot: true }, // Context renders from here
149
+ },
150
+ ],
151
+ },
152
+ ],
153
+ },
154
+ ]
155
+ ```
156
+
157
+ This is useful when contexts are nested inside shared layouts but should render independently from their root component.
158
+
159
+ ### `<MultiRouterContext>`
160
+
161
+ Component that defines a routing context boundary. By default, it also acts as an activator — clicking inside the context activates it.
162
+
163
+ **Props:**
164
+
165
+ - `type: string` - Context type identifier (for debugging/organization)
166
+ - `name: string` - Unique context identifier
167
+ - `location?: string` - Force specific location (overrides storage)
168
+ - `initial-location?: string` - Initial location for new contexts
169
+ - `history-enabled?: boolean` - Whether to track in browser history (default: `true`)
170
+ - `default?: boolean` - Activate by default if no saved context exists
171
+ - `activator?: boolean` - Whether to activate context on mousedown (default: `true`). Set to `false` to opt out of built-in activation behavior
172
+ - `prevent-class?: string` - CSS class that prevents activation on click, useful if you want to prevent activation on click of a button that destroys the context
173
+
174
+ To disable the built-in activator:
175
+
176
+ ```vue
177
+ <MultiRouterContext type="panel" name="panel-1" :activator="false">
178
+ <!-- manage activation manually -->
179
+ </MultiRouterContext>
180
+ ```
181
+
182
+ ### `<MultiRouterContextActivator>`
183
+
184
+ Standalone wrapper component that activates context on user interaction. Useful for advanced cases where you need fine-grained control over which element triggers activation, separate from the `MultiRouterContext` boundary.
185
+
186
+ **Props:**
187
+
188
+ - `prevent-class?: string` - CSS class that prevents activation on click
189
+ - `as?: string` - HTML element to render as wrapper (default: fragment/div)
190
+
191
+ ### `useMultiRouter()`
192
+
193
+ Composable for accessing multi-router outside a context.
194
+
195
+ **Returns:**
196
+
197
+ - `activeContextKey: ComputedRef<string | undefined>` - Currently active context
198
+ - `activeHistoryContextKey: ComputedRef<string | undefined>` - Context controlling browser URL
199
+ - `setActive(contextKey: string, updateHistory?: boolean): void` - Activate a context
200
+ - `hasContext(contextKey: string): boolean` - Check if context exists
201
+
202
+ ### `useMultiRouterContext()`
203
+
204
+ Composable for use inside a `MultiRouterContext`.
205
+
206
+ **Returns:**
207
+
208
+ - `manager: useMultiRouter()` - MultiRouter manager instance
209
+ - `contextKey: string` - This context's key
210
+ - `isActive: ComputedRef<boolean>` - Whether this context is active
211
+ - `isHistoryActive: ComputedRef<boolean>` - Whether this context controls browser URL
212
+ - `activeContextKey: ComputedRef<string>` - Currently active context key
213
+ - `activeHistoryContextKey: ComputedRef<string>` - Currently active history context key
214
+ - `historyEnabled: ComputedRef<boolean>` - Whether history is enabled for this context
215
+ - `activate(updateHistory?: boolean): void` - Activate this context
216
+ - `setActive(contextKey: string, updateHistory?: boolean): void` - Activate a context
217
+ - `hasContext(contextKey: string): boolean` - Check if context exists
218
+
219
+ ## Examples
220
+
221
+ ### Cards with Query Parameters
222
+
223
+ ```vue
224
+ <template>
225
+ <div v-for="card in cards" :key="card.id">
226
+ <MultiRouterContext
227
+ type="card"
228
+ :name="`card-${card.id}`"
229
+ initial-location="/card/content"
230
+ :history-enabled="false"
231
+ >
232
+ <CardContent @close="removeCard(card.id)" />
233
+ </MultiRouterContext>
234
+ </div>
235
+ </template>
236
+ ```
237
+
238
+ ### Accessing Route in Context
239
+
240
+ ```vue
241
+ <script setup>
242
+ import { useRouter, useRoute } from 'vue-router'
243
+
244
+ const router = useRouter()
245
+ const route = useRoute()
246
+
247
+ // Navigate within this context
248
+ function goToPage(path) {
249
+ router.push(path)
250
+ }
251
+
252
+ // Access query params
253
+ const searchQuery = computed(() => route.query.q)
254
+ </script>
255
+ ```
256
+
257
+ ## Peer Dependencies
258
+
259
+ - `vue`: ^3.0.0
260
+ - `vue-router`: ^4.0.0 || ^5.0.0
261
+
262
+ ## License
263
+
264
+ MIT
265
+
266
+ ## Development
267
+
268
+ ### Running Playground Locally
269
+
270
+ ```bash
271
+ # Development mode (hot reload)
272
+ npm run play
273
+
274
+ # Production preview
275
+ npm run build:playground
276
+ npm run preview:playground
277
+ ```
278
+
279
+ ### Building
280
+
281
+ ```bash
282
+ # Build library
283
+ npm run build
284
+
285
+ # Build playground for deployment
286
+ npm run build:playground
287
+ ```
288
+
289
+ ### Testing & Quality
290
+
291
+ ```bash
292
+ # Run all checks
293
+ npm run check
294
+
295
+ # Type checking
296
+ npm run ts:check
297
+
298
+ # Linting
299
+ npm run lint
300
+
301
+ # Formatting
302
+ npm run format
303
+ ```
304
+
305
+ ## Contributing
306
+
307
+ Contributions are welcome! Please feel free to submit a Pull Request.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as vue7 from "vue";
1
+ import * as vue0 from "vue";
2
2
  import { App, InjectionKey, PropType } from "vue";
3
3
  import { Router, RouterHistory, RouterOptions } from "vue-router";
4
4
 
@@ -175,7 +175,7 @@ declare function onMultiRouterContextActivate(callback: (name: string) => void):
175
175
  //#endregion
176
176
  //#region src/components/MultiRouterContext.vue.d.ts
177
177
  declare const _default: typeof __VLS_export$1;
178
- declare const __VLS_export$1: vue7.DefineComponent<vue7.ExtractPropTypes<{
178
+ declare const __VLS_export$1: vue0.DefineComponent<vue0.ExtractPropTypes<{
179
179
  type: {
180
180
  type: StringConstructor;
181
181
  required: true;
@@ -228,9 +228,9 @@ declare const __VLS_export$1: vue7.DefineComponent<vue7.ExtractPropTypes<{
228
228
  type: PropType<string | null>;
229
229
  default: null;
230
230
  };
231
- }>, () => vue7.VNode<vue7.RendererNode, vue7.RendererElement, {
231
+ }>, () => vue0.VNode<vue0.RendererNode, vue0.RendererElement, {
232
232
  [key: string]: any;
233
- }>, {}, {}, {}, vue7.ComponentOptionsMixin, vue7.ComponentOptionsMixin, {}, string, vue7.PublicProps, Readonly<vue7.ExtractPropTypes<{
233
+ }>, {}, {}, {}, vue0.ComponentOptionsMixin, vue0.ComponentOptionsMixin, {}, string, vue0.PublicProps, Readonly<vue0.ExtractPropTypes<{
234
234
  type: {
235
235
  type: StringConstructor;
236
236
  required: true;
@@ -288,11 +288,11 @@ declare const __VLS_export$1: vue7.DefineComponent<vue7.ExtractPropTypes<{
288
288
  default: boolean;
289
289
  activator: boolean;
290
290
  preventClass: string | null;
291
- }, {}, {}, {}, string, vue7.ComponentProvideOptions, true, {}, any>;
291
+ }, {}, {}, {}, string, vue0.ComponentProvideOptions, true, {}, any>;
292
292
  //#endregion
293
293
  //#region src/components/MultiRouterContextActivator.vue.d.ts
294
294
  declare const _default$1: typeof __VLS_export;
295
- declare const __VLS_export: vue7.DefineComponent<vue7.ExtractPropTypes<{
295
+ declare const __VLS_export: vue0.DefineComponent<vue0.ExtractPropTypes<{
296
296
  as: {
297
297
  type: PropType<string | null>;
298
298
  default: null;
@@ -302,11 +302,11 @@ declare const __VLS_export: vue7.DefineComponent<vue7.ExtractPropTypes<{
302
302
  default: null;
303
303
  required: false;
304
304
  };
305
- }>, (() => vue7.VNode<vue7.RendererNode, vue7.RendererElement, {
305
+ }>, (() => vue0.VNode<vue0.RendererNode, vue0.RendererElement, {
306
306
  [key: string]: any;
307
- }>[] | undefined) | (() => vue7.VNode<vue7.RendererNode, vue7.RendererElement, {
307
+ }>[] | undefined) | (() => vue0.VNode<vue0.RendererNode, vue0.RendererElement, {
308
308
  [key: string]: any;
309
- }>), {}, {}, {}, vue7.ComponentOptionsMixin, vue7.ComponentOptionsMixin, {}, string, vue7.PublicProps, Readonly<vue7.ExtractPropTypes<{
309
+ }>), {}, {}, {}, vue0.ComponentOptionsMixin, vue0.ComponentOptionsMixin, {}, string, vue0.PublicProps, Readonly<vue0.ExtractPropTypes<{
310
310
  as: {
311
311
  type: PropType<string | null>;
312
312
  default: null;
@@ -319,7 +319,7 @@ declare const __VLS_export: vue7.DefineComponent<vue7.ExtractPropTypes<{
319
319
  }>> & Readonly<{}>, {
320
320
  preventClass: string | null;
321
321
  as: string | null;
322
- }, {}, {}, {}, string, vue7.ComponentProvideOptions, true, {}, any>;
322
+ }, {}, {}, {}, string, vue0.ComponentProvideOptions, true, {}, any>;
323
323
  //#endregion
324
324
  //#region src/contextManager.d.ts
325
325
  type ContextInterface = {
@@ -349,9 +349,9 @@ declare class MultiRouterManagerInstance {
349
349
  constructor(app: App, historyManagerOptions: HistoryManagerOptions, makeRouter: MakeRouterFn);
350
350
  getHistoryManager(): MultiRouterHistoryManager;
351
351
  getActiveContext(): ActiveContextInterface | undefined;
352
- getActiveContextRef(): vue7.ShallowRef<ActiveContextInterface | undefined, ActiveContextInterface | undefined>;
352
+ getActiveContextRef(): vue0.ShallowRef<ActiveContextInterface | undefined, ActiveContextInterface | undefined>;
353
353
  getActiveHistoryContext(): ActiveContextInterface | undefined;
354
- getActiveHistoryContextRef(): vue7.ShallowRef<ActiveContextInterface | undefined, ActiveContextInterface | undefined>;
354
+ getActiveHistoryContextRef(): vue0.ShallowRef<ActiveContextInterface | undefined, ActiveContextInterface | undefined>;
355
355
  setActive(key: string, updateHistory: boolean): boolean;
356
356
  clearHistoryContext(key: string): void;
357
357
  markAsStarted(): void;
@@ -381,9 +381,9 @@ declare class MultiRouterManagerInstance {
381
381
  */
382
382
  declare function useMultiRouter(): {
383
383
  manager: MultiRouterManagerInstance;
384
- activeContext: vue7.ComputedRef<ActiveContextInterface | undefined>;
385
- activeContextKey: vue7.ComputedRef<string | undefined>;
386
- activeHistoryContextKey: vue7.ComputedRef<string | undefined>;
384
+ activeContext: vue0.ComputedRef<ActiveContextInterface | undefined>;
385
+ activeContextKey: vue0.ComputedRef<string | undefined>;
386
+ activeHistoryContextKey: vue0.ComputedRef<string | undefined>;
387
387
  setActive: (contextKey: string, updateHistory?: boolean) => void;
388
388
  hasContext: (contextKey: string) => boolean;
389
389
  };
@@ -392,11 +392,11 @@ declare function useMultiRouter(): {
392
392
  declare function useMultiRouterContext(): {
393
393
  manager: MultiRouterManagerInstance;
394
394
  contextKey: string;
395
- isActive: vue7.ComputedRef<boolean>;
396
- isHistoryActive: vue7.ComputedRef<boolean>;
397
- activeContextKey: vue7.ComputedRef<string | undefined>;
398
- activeHistoryContextKey: vue7.ComputedRef<string | undefined>;
399
- historyEnabled: vue7.ComputedRef<boolean>;
395
+ isActive: vue0.ComputedRef<boolean>;
396
+ isHistoryActive: vue0.ComputedRef<boolean>;
397
+ activeContextKey: vue0.ComputedRef<string | undefined>;
398
+ activeHistoryContextKey: vue0.ComputedRef<string | undefined>;
399
+ historyEnabled: vue0.ComputedRef<boolean>;
400
400
  activate: (updateHistory?: boolean) => void;
401
401
  setActive: (contextKey: string, updateHistory?: boolean) => void;
402
402
  hasContext: (contextKey: string) => boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vue-multi-router",
3
3
  "type": "module",
4
- "version": "0.1.2",
4
+ "version": "0.1.3",
5
5
  "description": "Vue 3 multi router",
6
6
  "author": "",
7
7
  "license": "MIT",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "peerDependencies": {
50
50
  "vue": "^3.5.0",
51
- "vue-router": "^4.0.0"
51
+ "vue-router": "^4.0.0 || ^5.0.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "vitepress": "^1.6.3",