๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Web/Vue

[Vue] router multiple paths, redirect to default path

๋ฐ˜์‘ํ˜•

 

var router = new VueRouter({
  //mode: 'history',
  routes : [
    { path: '/', redirect: '/profile' },
    { path: '/order', component: Order },
    { path: '/profile', component: Profile,
      children: [
        { path: '', component: ProfileTab1 },
        { path: 'tab1', component: ProfileTab1 },
        { path: 'tab2', component: ProfileTab2 },
      ]
    },
    { path: '*', component: NotFoundComponent }
  ]
});

 

 

 

 

 

 

 

alias ์‚ฌ์šฉ

 

routes: [
  { path: '/foo', component: Foo, alias: '/bar'}
]

 

 

https://github.com/vuejs/vue-router/blob/dev/examples/route-alias/app.js

 

vuejs/vue-router

๐Ÿšฆ The official router for Vue.js. Contribute to vuejs/vue-router development by creating an account on GitHub.

github.com

 

 

 

https://stackoverflow.com/questions/44916403/vuejs-vue-router-match-multiple-paths

 

(VueJS) vue-router match multiple paths

I am using vue-router, and am looking to match two very distinct paths. Is there some kind of array notation I can use?

stackoverflow.com

 

https://stackoverflow.com/questions/44060414/vue-router-redirect-to-default-path-issue

 

vue-router redirect to default path issue

I want to default to a specific page when user navigates to the root path ie when used goes to myapp.com I want to redirect them to myapp.com/defaultpage My current code is index.js import Full ...

stackoverflow.com

 

๋ฐ˜์‘ํ˜•

'Web > Vue' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[Vue.js] Grid  (0) 2022.06.07
[Vue.js] vue-router.js cdn ์˜ค๋ฅ˜  (0) 2022.05.04
[Vue.js] CLI ์„ค์น˜ํ•˜๊ธฐ  (0) 2020.12.14
[Vue.js] Vuetify, v-data-table  (0) 2020.12.02
Vuetify, refs  (0) 2020.11.27