【vue】router-view渲染空白,报错Failed to mount component: template or render function not defined
问题描述
router-view渲染空白,控制台报错Failed to mount component: template or render function not defined。并且使用了路由懒加载。
问题原因
路由懒加载错误,路由的component接受的是一个函数
问题解决
调整component参数即可
例:
//直接用变量
const Foo = () => import('./Foo.vue')
const router = new VueRouter({
routes: [
原创
2020-07-23 17:28:14 ·
1114 阅读 ·
1 评论