您的位置:首页 > 产品设计 > UI/UE

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

2017-12-22 17:24 1996 查看
场景重现:

在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",没有其他方法了。以后有更好的方法再更新。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  vue scope slot-scope 64位
相关文章推荐