forked from LinusBorg/portal-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrouter.ts
90 lines (85 loc) · 2.26 KB
/
router.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
import Vue from 'vue'
import VueRouter from 'vue-router'
import ToggleExample from './components/toggle/toggle-example.vue'
import TargetSwitch from './components/target-switch/target-switch.vue'
import SourceSwitch from './components/source-switch/source-switch.vue'
import Disabled from './components/disabled/index.vue'
import ScopedSlots from './components/scoped-slots/index.vue'
import CompAsRoot from './components/comp-as-root/comp-as-root.vue'
import Programmatic from './components/programmatic/index.vue'
import RouterViewWithPortals from './components/router-view-with-portals/index.vue'
import RouterViewWithPortalsA from './components/router-view-with-portals/a.vue'
import RouterViewWithPortalsB from './components/router-view-with-portals/b.vue'
import MountToExternal from './components/mount-to/mount-to-external.vue'
import EmptyPortal from './components/empty-portal/index.vue'
import DefaultSlotContent from './components/default-content-on-target/index.vue'
import Transitions from './components/transitions/transitions.vue'
import Multiple from './components/multiple/multiple.vue'
Vue.use(VueRouter)
const routes = [
{
path: '/',
redirect: '/toggle',
},
{
path: '/toggle',
component: ToggleExample,
},
{
path: '/target-switch',
component: TargetSwitch,
},
{
path: '/source-switch',
component: SourceSwitch,
},
{
path: '/disabled',
component: Disabled,
},
{
path: '/scoped',
component: ScopedSlots,
},
{
path: '/component-as-root-element',
component: CompAsRoot,
},
{
path: '/empty',
component: EmptyPortal,
},
{
path: '/programmatic',
component: Programmatic,
},
{
path: '/router-view-with-portals',
component: RouterViewWithPortals,
children: [
{ path: 'a', component: RouterViewWithPortalsA },
{ path: 'b', component: RouterViewWithPortalsB },
],
},
{
path: '/default-slot-content-for-target',
component: DefaultSlotContent,
},
{
path: '/transitions',
component: Transitions,
},
{
path: '/Mount-to-external-element',
component: MountToExternal,
},
{
path: '/multiple',
component: Multiple,
},
]
const router = new VueRouter({
mode: 'history',
routes,
})
export { routes, router as default }