Routes.js File

From rbachwiki
Revision as of 18:08, 17 October 2018 by Bacchas (talk | contribs) (Created page with "<pre> import User from './components/User.vue'; import UserDetail from './components/UserDetail.vue'; import UserEdit from './components/UserEdit.vue'; import UserStart from '...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
import User from './components/User.vue';
import UserDetail from './components/UserDetail.vue';
import UserEdit from './components/UserEdit.vue';
import UserStart from './components/UserStart.vue';
import Home from './components/Home.vue';




export const myRoutes = [
    { path: '', component: Home },
    { path: '/user', component: User, children:[
        {path: '', component: UserStart},
        {path: ':id', component: UserDetail, beforeEnter:(to, from, next)=>{
            console.log('inside rout setup');
            next();
        }},
        {path: ':id/edit', component: UserEdit, name: 'userEdit'}

    ] },
    {path: '/redirect-me', redirect: '/user'},
    {path: '*', redirect: '/'}

];

VueJs Routing