分类
默认

如何配置 Vue-router 异步加载

异步加载,也叫懒加载。示例:

export default new VueRouter({
    routes: [
        {
            path: '/',
            component: () => import(
                /* webpackChunkName:"navigator" */
                './../components/Navigator'
            )
        },
        {
            path: '/feedback',
            component: () => import(
                /* webpackChunkName:"feedback" */
                './../components/Feedback'
                )
        }
    ]
})