Vue报错——the "scope" attribute for scoped slots have been deprecated and replaced by "slot-scope"

 
 

场景重现:
在git上克隆完同事上传的Vue项目,用VS Code运行时报错。

VS Code运行栏报错:
the "scope" attribute for scoped slots have been deprecated and replaced by "slot-scope" since 2.5.
The new "slot-scope" attribute can also be used on plain elements in addition to <template> to denote scoped slots.

原因:
"scope"标签自Vue 2.5版本后被遗弃,替代的新标签时"slot-scope",优先常看双方的Vue版本,可能是因为Vue版本不一致。
在我这种情况里,我得Vue版本为2.8.2,他的版本为2.3.3。所以同志们,协同开发之前,一定要记得跟好基友的版本一致啊!

解决方法:
待更新~目前貌似除了全局更换标签,把scope=“scope”更换为slot-scope="scope",没有其他方法了。以后有更好的方法再更新。


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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值