vue2.x和vue3.x关于获取表格某一行的写法真的不同绝了

发布时间 2023-10-18 17:44:49作者: yesyes1

vue2.x

<el-table-column label="测试" align="center" prop="ce">
    <template slot-scope="scope">
        <span>{{scope.row.ce}}</span>
    </template> 

vue3.x

<el-table-column prop="msgType" label="消息内容">
   <template #default="scope">
      <el-button link type="primary" size="small" @click="handleClick(scope.row)">修改</el-button>
    </template>
</el-table-column>

<script>
   methods: {
    handleClick(e){
      alert(e.id);
    },
</script>

点击修改: