antd-vue中给table表格整行加点击事件

table
    :columns="columns"
    :dataSource="data"
    :loading="loading"
    :pagination="pagination"
    :rowKey="record => record.id"
    @change="paginationChange"
    bordered
    :customRow="click"  // 这个是重点,主要是给table添加属性的作用
>

    // 内容



methods: {
    click(record, index){
        return {
            on: {
               click: () => {
                    console.log(record,index)
               }
            }
        }
    }
}

注:不仅可以添加点击事件还可以添加其他的事件

转载于:https://www.cnblogs.com/lanshu123/p/11088610.html

你可能感兴趣的:(antd-vue中给table表格整行加点击事件)