今天入职新公司第二天,公司框架用vue2.6+ts 同事都用webStorm,因为习惯用了vsCode所以选择继续使用vsCode,但是发现,项目中对于ts的语法检查有很多错误.虽然编译可以通过,但是文件飘红,实在是太难受,必须改掉.
具体为 vue2.6 + elementUI + ts 的插槽显示语法检查错误问题,slot-scope="scope" slot="header"
报错为:类型“Content”上不存在属性“scope”。//Content为继承vue的类
<template #header="scope">
</template>
<template #default="scope">
{{scope.row.name}}
</template>
指路:插槽 — Vue.js (vuejs.org)
renaissance