项目加载顺序
main.js -->App.vue-->router/index.js
main.js 入口文件
new Vue({
el: '#app',
router,
store,
render: h => h(App)
})
App.vue
<script>
export default {
name: 'App' //export App的组件,main.js就可以找到它
}
</script>
router/index.js
export default router{
router:[
{
path: '/redirect',
component: Layout,
hidden: true,
children: [
{
path: '/redirect/:path*',
component: () => import('@/views/redirect/index')
}
]
},
{
path: '/login',
component: () => import('@/views/login/index'),
hidden: true
},
]
}
网友评论