[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.问题的解决方法

通过vuecli学习路由封装的时候出现如下错误:

vue.runtime.esm.js?2b0e:619 [Vue warn]: Unknown custom element:  - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

--->  at src/App.vue
       
[Vue warn]: Unknown custom element: <router-vue> - did you register the component correctly? For recursive components, make sure to provide the

解决方法:

报错提示是因为没有注册路由出现的错误,所以我们应该要先从router.js中开始找

  • 在router.js中导入路由,注册router插件
[Vue warn]: Unknown custom element: <router-vue> - did you register the component correctly? For recursive components, make sure to provide the
  • 如果再次运行还是会出现错误,试着到APP.vue里面找错误,看App.vue里面是否缺,如果缺少就填上
[Vue warn]: Unknown custom element: <router-vue> - did you register the component correctly? For recursive components, make sure to provide the
  • 修改完后,运行,错误就解决了
[Vue warn]: Unknown custom element: <router-vue> - did you register the component correctly? For recursive components, make sure to provide the

你可能感兴趣的:([Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.问题的解决方法)