vue项目中的错误大全,提前了解,日后避坑

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

2 problems (2 errors, 0 warnings)

2个问题(2个错误,0个警告)

8d7642261a533f00bd56ddcc77504669.png

Compiled with problems:

编译错误

ERROR in ./src/views/HomeView.vue?

错误出现的位置

Unexpected keyword 'const'. (6:0)

第6行第0个字符有个不应该出现的关键字 const

63 | const user = reactive({ userid: "", pwd: "", code: "" }), | ^ 64 | const rules = reactive({ | ^ 65 | userid: [

第63到64行两个^之间有错误

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

总结:文件../views/admin/AdminVeiw.vue(文件名/路径发生错误)

ERROR in ./src/views/HomeView.vue

错误发生在HomeView.vue

VueCompilerError: Element is missing end tag.

标签没有结束标签

2 | <div class="login">

| ^

第二行的div

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'id')

没有捕捉到(承诺)类型错误:不能够与读取undefined的属性 (读取id)

beforecreate创建前

created 创建

mounted 挂载(显示渲染dom节点了)

<h1>{{joks[0].summary}}</h1>

joks默认是空的

TypeError: Cannot read properties of undefined (reading 'summary')

不能够在undefined上面读取 summary属性

getJok 获取数据

触发更新

updated 更新页面(有数据了更新数据显示出来了)

出现 []下标 .属性 用v-if (第一次不渲染,等待更新后再渲染)

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值