el-table-column 采用v-for

<el-table-column
   	v-for="item in PCSTitleList"
    :key="item"
    :label="item"
    show-overflow-tooltip
    :prop="item"
    min-width="70px"
    align="center"
>
   <template v-slot="scope">
       <div
           class="status-point"
           :class="scope.row[item] == 1 ? 'red' : ''"  //根据item,添加特殊样式
           @click="getDetailedFault(PCSTitleList.indexOf(item) + 1)" //根据不同的item,绑定不同的点击事件
        ></div>
     </template>
</el-table-column>

猜你喜欢

转载自blog.csdn.net/weixin_45288172/article/details/130949949
今日推荐