使用vue路由时报错

在使用vue路由时,发现页面无法显示,报错内容如下

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

解决:
我是通过引入使用路由的,发现引入时vue-router.js在vue.js前面

    <script src="vue-router.js"></script>
    <script src="vue.js"></script>

改为在后面引入即可

    <script src="vue.js"></script>
    <script src="vue-router.js"></script>

猜你喜欢

转载自www.cnblogs.com/Qi-Lin/p/12307071.html