Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tree): [tree] fix parent node toggle when click child node margin #2501

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/renderless/src/tree-node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/tree/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@opentiny/vue-tree",
"type": "module",
"version": "3.19.1",
"version": "3.19.2",
"description": "",
"license": "MIT",
"sideEffects": false,
Expand Down
1 change: 1 addition & 0 deletions packages/vue/src/tree/src/tree-node.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
>
<!-- 当前节点的行: 缩进块+left(箭头图标+单多选钮+loading+prefix+label+suffix)+right(finish图标+operation+编辑按钮) -->
<div
ref="content"
:class="{
'tiny-tree-node__content': true,
'tiny-tree-node__content-number': showNumber
Expand Down
Loading