|
@@ -76,7 +76,8 @@ const loadTree = async () => {
|
|
|
try {
|
|
try {
|
|
|
const { depts, currentId } = await loadDeptData()
|
|
const { depts, currentId } = await loadDeptData()
|
|
|
const targetKey = props.modelValue ?? (props.initSelect ? currentId : null)
|
|
const targetKey = props.modelValue ?? (props.initSelect ? currentId : null)
|
|
|
- if (props.initSelect && props.modelValue) {
|
|
|
|
|
|
|
+ // Only initialize the parent value when no external selection was provided.
|
|
|
|
|
+ if (props.initSelect && props.modelValue === undefined && currentId !== undefined) {
|
|
|
emits('update:modelValue', currentId)
|
|
emits('update:modelValue', currentId)
|
|
|
}
|
|
}
|
|
|
if (targetKey && !expandedKeys.value.includes(targetKey)) {
|
|
if (targetKey && !expandedKeys.value.includes(targetKey)) {
|