事件名 说明 参数
row-click 当某一行被点击时会触发该事件 row, column, event

举个栗子:

 1 <template>
 2   <el-table
 3     :data="tableData"
 4     stripe
 5     @row-click="handle"
 6     style="width: 100%">
 7     <el-table-column
 8       prop="date"
 9       label="日期"
10       width="180">
11     </el-table-column>
12   </el-table>
13 </template>
14 
15 <script>
16   export default {
17     data() {
18       return {
19         tableData: []
20       }
21     }22     methods: {
23       handle(row, event, column) {
24           console.log(row, event, column)
25        }
26     }
27   }
28 </script>

注:点击行就会触发handdle事件,row, event, column参数不需要写在html中,在方法里直接使用就可以了
参考:https://blog.csdn.net/Gochan_Tao/article/details/79606066
Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐