Vue常见报错整理 (从此报错不害怕)

整理一下Vue中一些常见的报错和bug,以及解决办法

 

示例1(文件名/路径发生错误

Compiled with problems:———编译问题:

 ERROR in ./src/router/index.ts 10:19-57

错误发生在 ./src/router/index.ts 第10行第19个字符到57字符

Module not found: Error: Can't resolve '../views/admin/AdminVeiw.vue' in 'C:\myel\src\router'

模块找不的 不能resolve(兑现,发现,解决)../views/admin/AdminVeiw.vue

在C:\myel\src\router

 

示例2(标签不完整

 ERROR in ./src/views/HomeView.vue

 错误发生在HomeView.vue

VueCompilerError: Element is missing end tag. 

标签没有结束标签

当看到这个报错,不要慌,你只是缺少了结束标签,把它补充上就好了

 

 示例3(error 'xxx' is not defind

bf5c55cba8ef3cdfba74897483458bb0.png 

C:\youmi\src\views\AboutView.vue

出错的文件路径 

16:17 error 'reactive' is not defined no-undef

第16行17字符错误 reactive 没有定义

 

  示例4(unknown mutation type: changeA

0e627ca2b16a9d5eeccab0f4e9d3f1d1.png a92498cc45017d734016b4a8d72b72c8.png

[vuex] unknown mutation type: changeA

vuex 找不到一个叫changeA的mutations

 

示例5(Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).) 

ERROR in ./src/views/AboutView.vue

 在AboutView发生错误

VueCompilerError: Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).

编译错误:属性name 不能不包含 (“),(‘)(<) 

 

 示例6(TypeError:Assignment to constant variable.

93de2b784608a226c53fa0f1b37a6ea4.png

const 不能重复赋值

 

 示例7(error 'check' is assigned a value but never used

4f2b20562097218b57c3d0af22826e8a.png 

error 'check' is assigned a value but never used no-unused-vars

'check' 被定义但没有被调用 

 

示例8(no-mixed-spaces-tabs) 

408689cd589e5fd2acda0f40276b7017.png 

Compiled with problems:

编译问题

C:\myel\src\views\HomeView.vue

错误出现文件

3:1 error Mixed spaces and tabs no-mixed-spaces-and-tabs

4:1 error Mixed spaces and tabs no-mixed-spaces-and-tabs

第3行的第一个字符

第4函的第一个字符

Mixed spaces and tabs

错误原因:混合的空格与tab

no-mixed-spaces-and-tabs

错误规则: no-mixed-spaces-and-tabs 不准混空格与tab

  • 9
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

稳重聪头

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值