之前用vscode运行vue项目,在vscode里面报错
(Emitted value instead of an instance of Error) 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.
但是项目能跑起来,不过控制台有警告:
后来我发现自己的vue是2.5.2版本的,而在2.5+的是不支持scope,而改用slot-scope。改完之后就发现没任何问题了,
正确代码
<template slot-scope="scope">
<span @click="toDeep(scope.row.areaname,scope.$index)" :class="{'isBlue':scope.row.areaname != '全国' && scope.row.areaname != '浙江全省'
&& scope.row.areaname != '浙江浙中' && scope.row.areaname != '浙江杭嘉'
&& scope.row.areaname != '江苏全省' && scope.row.areaname != '江苏苏北'}">
{{ scope.row.areaname }}
</span>
</template>