① 新建一个 Welcome.vue
② 在 router 中进行导入
使用 redirect 进行重定向
import Welcome from '@/components/Welcome'
Vue.use(VueRouter)
const routes = [
{path: '/',redirect:'/login'},
{path:'/login',component:Login},
{path:'/home',
component:Home,
redirect: '/weclome',
children: [
{ path: '/weclome', component:Welcome }
]},
]
const router = new VueRouter({
routes
})