排名
5
文章
229
粉丝
15
评论
7
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术

方法一:
页面
<el-table-column prop="courseName" label="测试获取行号" align="center" width="80">
<template slot-scope="{row,$index}">
<span @click="showTest(row,$index)">点击查看</span>
</template>
</el-table-column>
js方法
methods: {
showTest(my,index){
console.log(my)
console.log("行号",index)
},
方法二:
页面
<el-table-column prop="courseName" label="测试获取行号" align="center" width="80">
<template slot-scope="scope">
<span @click="showTest(scope)">点击查看</span>
</template>
</el-table-column>
js
methods: {
showTest(my){
console.log(my)
console.log("行号",my.$index)
},
本质是一样的,都是通过获取element ui table 列里边的$index属性
欢迎加群讨论技术,1群:677373950(满了,可以加,但通过不了),2群:656732739。有需要软件开发,或者学习软件技术的朋友可以和我联系~(Q:815170684)
评价