Elementui表格获取索引index用于v-for

Vue + Elementui

在<el-table-column>里获取每一行表格的索引,从0开始自增:

slot-scope="scope" 和 scope.$index 配合就能获取索引

<template slot-scope="scope">
    {{scope.%index}} <!--输出索引-->
</template>

 

posted @ 2022-03-07 18:02  沐橙汁  阅读(1640)  评论(0)    收藏  举报