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

分手后的思念是犯贱 2022-06-03 07:59 206阅读 0赞
  1. 场景重现: 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",没有其他方法了。以后有更好的方法再更新。

发表评论

表情:
评论列表 (有 0 条评论,206人围观)

还没有评论,来说两句吧...

相关阅读