vue umy-ui表格插槽scope.$rowIndex
文章目录
通过数据的下标删除对应数据,数据index和elementUI不一样,表格点击删除的时候插槽scope中获取不到$index:
ux-table-column插槽传参用scope.$rowIndex:
<ux-table-column title="操作" fixed="right" >
<template slot-scope="scope">
<el-button type="text" @click="remove(scope.$rowIndex)" >删除</el-button>
</template>
</ux-table-column>method:
remove(index){
console.log(index)
this.tableData.splice(index,1)
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论