<template>
<div>
<a-table :columns="columns" />
</div>
</template>
<script>
export default {
data() {
columns:[
{
title: '操作',
align: 'center',
dataIndex: 'action',
customRender: (text, record, index) => {
const delete =()=>{
this.handleDel(record.id); //调用method里面的方法
}
let content = (<a-button onClick={ delete }></a-button>);
const obj = {
children: content,
attrs: { colSpan: 1 },
};
return obj;
}
}
]
}
}
</script>