Skip to content

Commit 097120f

Browse files
committed
fix: tree udpate status
1 parent 2d31499 commit 097120f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "light-vue-tree",
3-
"version": "0.1.2",
3+
"version": "0.1.1",
44
"scripts": {
55
"lint": "eslint --fix src --ext .js --ext .vue",
66
"dev": "rollup --config ./scripts/rollup.development.js --watch",

src/components/Tree/Tree.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,14 @@ export default {
283283
}
284284
},
285285
recurTree (node) {
286-
if (this.checkStrictly || !this.showCheckbox) {
287-
this.getCheckedValue(node)
288-
node.children && node.children.forEach((child) => this.recurTree(child))
286+
if (node.isSelected() || node.isChecked() || (this.hasHalfelEction && node.isPartialSelected())) {
287+
if (this.checkStrictly || !this.showCheckbox) {
288+
this.getCheckedValue(node)
289+
} else {
290+
this.refreshNode(node) // 现在改为了 先下刷新 再向上刷新
291+
}
289292
} else {
290-
this.refreshNode(node)
293+
node.children && node.children.forEach((child) => this.recurTree(child))
291294
}
292295
},
293296
refreshExpandedDown (node) {

0 commit comments

Comments
 (0)