vue-router "path" is required in a route configuration

启用了动态路由,一直提示这个错误,页面打开也是空白,后来发现原来是component参数错误。
正确的写法为:

component: () => import ('@/views/own-space/own-space.vue')

我错误的写为了:

component:  import ('@/views/own-space/own-space.vue')

以为import就可以了,应该是vue-router里要求component为组件实例或者函数。

猜你喜欢

转载自www.cnblogs.com/xdao/p/vue_router_path_error.html