问题描述
iview 自定义列模板中的按钮与iview 中的@on-row-click事件的冒泡问题
问题出现的环境背景及自己尝试过哪些方法
我使用event.stopPropagetion()终止冒泡,控制台报错
部分代码
<Table height="400" @on-row-click="showRow" :loading="loading" border :columns="columns" :data="data"></Table>
{
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.show(params.index)
}
}
}, '详情'),
h('Button', {
props: {
type: 'error',
size: 'small'
},
on: {
click: () => {
this.remove(params.index)
event.stopPropagetion()
}
}
}, '删除')
]);
}
}