解决冲突

This commit is contained in:
13684185576
2025-07-31 11:39:51 +08:00
98 changed files with 55172 additions and 809 deletions

View File

@ -83,6 +83,10 @@ const props = defineProps({
inline: {
type: Boolean,
default: true
},
disabled: {
type: Boolean,
default: false
}
});
const elform = ref();
@ -103,18 +107,25 @@ const reset = () => {
elform.value.resetFields()
}
// 修改这里的watch逻辑避免无限循环
let isUpdatingFromProps = false;
watch(() => listQuery.value, (newVal) => {
if (newVal) emits("update:modelValue", newVal);
}, { immediate: true, deep: true });
if (newVal && !isUpdatingFromProps) {
emits("update:modelValue", newVal);
}
}, { deep: true });
watch(() => props.modelValue, (newVal) => {
// 只有在新值确实变化时才更新(避免空值覆盖)
if (newVal && Object.keys(newVal).length > 0) {
isUpdatingFromProps = true;
listQuery.value = { ...newVal };
setTimeout(() => {
isUpdatingFromProps = false;
}, 0);
}
}, { immediate: true, deep: true });
defineExpose({ submit, reset });
</script>