1
0
mirror of synced 2025-11-06 11:20:40 +08:00

add event clear-cell-area-selection

This commit is contained in:
xuliangzhan
2024-06-25 20:16:44 +08:00
parent a25eb65f80
commit 545cbadb8d
3 changed files with 6 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "vxe-table",
"version": "4.7.33",
"version": "4.7.34",
"description": "一个基于 vue 的 PC 端表格组件支持增删改查、虚拟树、列拖拽懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...",
"scripts": {
"update": "npm install --legacy-peer-deps",
@@ -28,7 +28,7 @@
"style": "lib/style.css",
"typings": "types/index.d.ts",
"dependencies": {
"vxe-pc-ui": "^4.0.31"
"vxe-pc-ui": "^4.0.33"
},
"devDependencies": {
"@types/resize-observer-browser": "^0.1.11",

View File

@@ -64,6 +64,7 @@ export default [
'cell-area-cut',
'cell-area-paste',
'cell-area-merge',
'clear-cell-area-selection',
'clear-cell-area-merge',
'header-cell-area-selection',
'cell-area-selection-invalid',

View File

@@ -4773,10 +4773,12 @@ export default defineComponent({
}
if (areaOpts.autoClear) {
if ($xeTable.clearCellAreas) {
if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
const cellAreas = $xeTable.getCellAreas()
if (cellAreas.length && !getEventTargetNode(evnt, document.body, 'vxe-table--ignore-areas-clear').flag) {
tablePrivateMethods.preventEvent(evnt, 'event.clearAreas', {}, () => {
$xeTable.clearCellAreas()
$xeTable.clearCopyCellArea()
$xeTable.dispatchEvent('clear-cell-area-selection', { cellAreas }, evnt)
})
}
}