Vue3 网页版报错或警告集锦(一)

Vue网页版报错或警告集锦

警告:Extraneous non-props attributes (class) were passed to component

Extraneous non-props attributes (class) were passed to component but could not be automatically inherited because component renders fragment or text root nodes

根因分析:可以参考这个[博客]。(https://blog.csdn.net/li_jia_h/article/details/123925787)其实就是传递了一个没用的class,所以产生了警告。
定位步骤

  • 查看警告信息,找到自己认识的组件,我这个报错可以看到到了Layout层,这是我知道的组件。
    在这里插入图片描述- 打开查看该文件,里面有NavTop组件的引用,nav-top这个类在Layout中没有找到使用的地方
<navTop  class="nav-top"></navTop>
  • 去掉nav-top,警告消失。

警告 custom-class is about to be deprecated in version 2.3.0, please use class instead.

error.ts:14 ElementPlusError: [el-dialog] [Attribute] custom-class is about to be deprecated in version 2.3.0, please use class instead.

根因分析
很明显,custom-class属性即将废弃。只要找到改掉就行。当然如果不介意的人也不用改。
定位步骤

  • 报错信息不是很明确,难以通过报错直接找到位置,点进去看了,都不是引用的地方
    在这里插入图片描述
  • 先全局搜索一下custom-class,发现只有一个地方用到了,把custom-class改成class。
<el-dialog v-model="kamiVisible" :center="true" width="360px" :close-on-click-modal="false" custom-class="dialog-mask" >
</el-dialog>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值