1.3.3 • Published 3 years ago

vue-router-stack v1.3.3

Weekly downloads
34
License
MIT
Repository
github
Last release
3 years ago

vue-router-stack

A Vue plugin provides router stack. It helps SPA/mobile app easily manage page navigation, by mapping router stack to real working pages.

Installation

npm install vue-router-stack

initialize the plugin

import VueRouterStack from 'vue-router-stack'

Vue.use(VueRouterStack, {
    router, // the instance of vue-router
    seqKey: 's~' // optional 
})

now, the full router stack can be visited like:

this.$stack.full

or visit the scoped stack, which is bound to current component instance

this.$stack.scoped

Typical use case

defines routes as usual

const routers = [
    {
        path: '/',
        component: IndexPage,
        children: [
            {
                path: '/foo',
                component: FooPage
            },
            {
                path: '/bar',
                component: BarPage
            }
        ]
    }
]

replace second level <route-view> tag with

<router-view>
    <component
    v-for="entry in $stack.scoped"
    :key="entry.fullPath"
    :is="entry.component"
    />
</router-view>
1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.2.0

4 years ago

1.3.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.9.8

4 years ago

0.9.7

4 years ago

0.9.6

4 years ago

0.9.5

4 years ago

0.9.4

4 years ago

0.9.3

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago