Vue.js 2.5 / Visual Studio代码编辑器
我收到此es-lint警告,如何摆脱它?
<template :slot="slotName" slot-scope="props" v-for="slotName in $scopedSlots?Object.keys($scopedSlots):null">
<slot :name="slotName" :row-data="props.rowData" :row-index="props.rowIndex" :row-field="props.rowField"></slot>
</template>
我试图添加索引,但不能解决此问题
<template :slot="slotName" slot-scope="props" v-for="(slotName, index) in $scopedSlots?Object.keys($scopedSlots):null" :key="index">
<slot :name="slotName" :row-data="props.rowData" :row-index="props.rowIndex" :row-field="props.rowField"></slot>
</template>
这项工作对我来说