Vue2.0
{
path: '/index',
name: 'AppIndex',
component: AppIndex,
meta: {
requireAuth: true
}
},
{
path: '/library',
name: 'Library',
component: LibraryIndex,
meta: {
requireAuth: true
}
}
Vue3.0:
{
path: '/index',
name: 'AppIndex',
component: () => import('../components/home/AppIndex')
},
{
path: '/library',
name: 'Library',
component: () => import('../components/library/LibraryIndex')
}
不同点:compon那里的写法不一样。