mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [tree]: fix dynamic binding defaultCheckedKeys trigger rerender (#21503)
* fix(components): [tree]: Fix Dynamic Binding Expression Fix issue #21130 * fix(components): [tree]: Fix Dynamic Binding Expression * fix(components): [tree]: Fix Dynamic Binding Expression * fix(components): [tree]: Fix Dynamic Binding Expression
This commit is contained in:
@@ -57,6 +57,7 @@ import { useNodeExpandEventBroadcast } from './model/useNodeExpandEventBroadcast
|
||||
import { useDragNodeHandler } from './model/useDragNode'
|
||||
import { useKeydown } from './model/useKeydown'
|
||||
import { ROOT_TREE_INJECTION_KEY } from './tokens'
|
||||
import { isEqual } from 'lodash-unified'
|
||||
|
||||
import type Node from './model/node'
|
||||
import type { ComponentInternalInstance, PropType } from 'vue'
|
||||
@@ -224,7 +225,9 @@ export default defineComponent({
|
||||
|
||||
watch(
|
||||
() => props.defaultCheckedKeys,
|
||||
(newVal) => {
|
||||
(newVal, oldVal) => {
|
||||
if (isEqual(newVal, oldVal)) return
|
||||
|
||||
store.value.setDefaultCheckedKey(newVal ?? [])
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user