首页跳转到子路由

This commit is contained in:
xing 2020-06-17 11:01:34 +08:00
parent 055fd8c871
commit 00f43f2580

View File

@ -2,6 +2,7 @@ import Vue from 'vue'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
import Login from '../components/Login' import Login from '../components/Login'
import Home from '../components/Home' import Home from '../components/Home'
import welcome from '../components/welcome'
Vue.use(VueRouter) Vue.use(VueRouter)
@ -15,7 +16,14 @@ const routes = [
}, },
{ {
path: '/home', path: '/home',
component: Home component: Home,
redirect: '/welcome',
children: [
{
path: '/welcome',
component: welcome
}
]
} }
] ]