columns4: [
{
title: '操作',
key: 'action',
width: 150,
align: 'center',
render: (h, params) => {
return h('div', [
h('Button', {
props: {
type: 'primary',
size: 'small'
},
style: {
marginRight: '5px'
},
on: {
click: () => {
this.modalShow(params.index)
}
}
}, '編輯'),
h('Poptip', {
style:{
textAlign: 'left'
},
props: {
placement:'left-start',
confirm: true,
title: '確定刪除嗎?',
},
on: {
// 必須是箭頭函數寫法
'on-ok': ()=> {
//調用刪除方法
this.remove(params.index)
console.log('刪除')
},
'on-cancel': ()=> {
console.log('取消')
}
}
},[
h('Button', {
props: {
type: 'error',
size: 'small'
},
on: {
click: () => {
//this.remove(params.index)
}
}
}, '刪除')
]),
]);
}
}
],