修复属性刷新反复被折叠的bug

This commit is contained in:
xu_yanfeng 2025-01-07 19:44:31 +08:00
parent 6ec242e57c
commit b3da760863

View File

@ -63,20 +63,11 @@ export default defineComponent({
watch( watch(
() => props.value, () => props.value,
(newData, oldData) => { (newData, oldData) => {
if (newData.id !== oldData.id) {
// id
expand.value = false;
subData.value = [];
}
freshSubData(newData); freshSubData(newData);
} }
); );
const subData = ref<Array<Property>>([]); const subData = ref<Array<Property>>([]);
function freshSubData(data: Info) { function freshSubData(data: Info) {
const rawExpand = toRaw(expand.value);
if (!rawExpand) {
return;
}
const rawValue = toRaw(data); const rawValue = toRaw(data);
if (!rawValue) { if (!rawValue) {
return; return;