diff --git a/package.json b/package.json index bcfcd5b..f7dd8da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wsfe/vue-tree", - "version": "4.0.0", + "version": "4.0.1", "types": "./types", "description": "A vue tree component using virtual list.", "main": "./dist/vue-tree.umd.js", diff --git a/src/components/TreeSearch.vue b/src/components/TreeSearch.vue index ad525e6..12171c6 100644 --- a/src/components/TreeSearch.vue +++ b/src/components/TreeSearch.vue @@ -224,11 +224,11 @@ function search(keyword1?: string): Promise { //#region Event handlers /** 处理全选点击 */ function handleCheckAll(): void { - const keyField = treeRef.value?.keyField + const keyField = props.keyField if (props.searchDisabled || checkAllStatus.disabled || !treeRef.value || !keyField) return const currentVisibleKeys = treeRef.value.getCurrentVisibleNodes().map((node: TreeNode) => node[keyField]) - if (checkAllStatus.checked || checkAllStatus.indeterminate) { + if (checkAllStatus.checked) { // 反选 treeRef.value.setCheckedKeys(currentVisibleKeys, false) } else {