vue常见错误及解决办法

编程入门 行业动态 更新时间:2024-10-13 10:24:37

vue常见错误及<a href=https://www.elefans.com/category/jswz/34/1767401.html style=解决办法"/>

vue常见错误及解决办法

1、在配置路由并引入组件后,报错:

    Unknown custom element: <router-link> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

  错误原因:vue-router没有注册

  解决办法:

    //注册插件 *****************非常重要,不能忘记

    Vue.use(VueRouter)

2、在组件中的标签和样式中图片路径出错时:报错:

    Errors while compiling. Reload prevented.

    Module not found: Error: Can't resolve './src/assets/img/btn_bg.png' in 'E:\myStudy\vue案例\chexian-spa\src\components'

  解决办法:将图片的路径重新书写

3、在组件中标签没有闭合,报错:

     Errors while compiling. Reload prevented.

    ./node_modules/_vue-loader@13.4.0@vue-loader/lib/template-compiler?{"id":"data-v-00822b28","hasScoped":false,"buble":{"transforms":{}}}!./node_modules/_vue-loader@13.4.0@vue-loader/lib/selecto

更多推荐

vue常见错误及解决办法

本文发布于:2024-02-07 09:31:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1755302.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:解决办法   常见   错误   vue

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!