-
vue11(redirect 리다이렉트 )JS/vue.js 2022. 3. 15. 18:25
Redirect : 특정 URL 접속시 다른 URL로 보내는 기능
const routes = [ { path: '/', component: () => import('./components/Bbb'), redirect: '/home', children: [ { path: 'home', component: () => import('./components/Home'), name: "home" }] }
다음과 같이 path 가 '/'인 경우에 redirect: '/home'으로 걸어두면
자동으로 넘어간다.
'JS > vue.js' 카테고리의 다른 글
vue13(vuex) (0) 2022.03.16 vue12(vue-router #,/#/ 제거하기) (0) 2022.03.16 에러6(.env에러/ELIFECYCLE/this is probably not a problem with npm) (0) 2022.03.15 vue10(동적 컴포넌트 component tag / 컴포넌트 갈아끼우기) (0) 2022.03.15 vue9(props,emit) (0) 2022.03.14