结合官方文档:https://2x.antdv.com/components/table-cn
<a-table
:rowClassName="
(record, index) => (index % 2 === 1 ? 'table-striped' : null)
"
class="ant-table-striped"
:columns="columns"
:data-source="orderList"
:customRow="rowClick" //点击行事件
}}
>
</a-table>
/**
* vue3.0写法
*/
function rowClick(record, index) {
return {
onclick: () => {
console.log(record,index)
}
}
},