diff --git a/components/vc-tree-select/generate.tsx b/components/vc-tree-select/generate.tsx index 9c96d84f8..228dddc0f 100644 --- a/components/vc-tree-select/generate.tsx +++ b/components/vc-tree-select/generate.tsx @@ -173,16 +173,15 @@ export default function generate(config: { getEntityByValue, }); - const valueRef = ref(props.defaultValue); + const valueRef = ref( + props.value === undefined ? props.defaultValue : props.value, + ); watch( () => props.value, () => { - if (props.value !== undefined) { - valueRef.value = props.value; - } + valueRef.value = props.value; }, - { immediate: true }, ); /** Get `missingRawValues` which not exist in the tree yet */