From f78a509dd36229c860f5beb52e1e3376c5061e16 Mon Sep 17 00:00:00 2001 From: Gimmy <975402925@qq.com> Date: Fri, 8 Nov 2024 14:29:29 +0800 Subject: [PATCH] fix(tree): [tree] fix parent node toggle when click child node margin close #2491 --- packages/renderless/src/tree-node/index.ts | 6 ++++++ packages/vue/src/tree/package.json | 2 +- packages/vue/src/tree/src/tree-node.vue | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/renderless/src/tree-node/index.ts b/packages/renderless/src/tree-node/index.ts index 085fe8c6f0..a839e74fab 100644 --- a/packages/renderless/src/tree-node/index.ts +++ b/packages/renderless/src/tree-node/index.ts @@ -86,6 +86,12 @@ export const handleSelectChange = export const handleClick = ({ api, vm, props, state }) => (e) => { + // tiny 新增: 点击子节点之间的空白时,不会收齐父节点 + const contentElm = vm.$refs.content + if (contentElm && !contentElm.contains(e?.target)) { + return + } + // tiny 新增: 去掉trigger参数,不影响点击的逻辑 const store = state.tree.state.store diff --git a/packages/vue/src/tree/package.json b/packages/vue/src/tree/package.json index 42aa8c2c72..657c725762 100644 --- a/packages/vue/src/tree/package.json +++ b/packages/vue/src/tree/package.json @@ -1,7 +1,7 @@ { "name": "@opentiny/vue-tree", "type": "module", - "version": "3.19.1", + "version": "3.19.2", "description": "", "license": "MIT", "sideEffects": false, diff --git a/packages/vue/src/tree/src/tree-node.vue b/packages/vue/src/tree/src/tree-node.vue index 150a91dad5..cc4da6bea5 100644 --- a/packages/vue/src/tree/src/tree-node.vue +++ b/packages/vue/src/tree/src/tree-node.vue @@ -47,6 +47,7 @@ >