vue3中jsx中使用withModifiers阻止子元素点击事件冒泡到父元素
用于向事件处理函数添加内置 v-on 修饰符。
类型
jsx
const columns = [
{
title: '文件名', key: 'name', render: (row) => {
return <div onClick={() => handleClickName(row)} style="cursor: pointer;width: 100%"
class="fx al-ct ju-sb fx-gp02 mouse-active-show-container">
<div class="fx al-ct fx-gp05">
{readerFileIcon(row)}
<span>{row.name}</span>
</div>
{
row.type === 'folder'
? <n-icon class="mouse-active-show-element" size="20">
<Close onClick={withModifiers(() => handleClickDeleteFolder(row), ['stop'])}/>
</n-icon>
: null
}
</div>
}
}
]