mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
fix(form): formState需要同步props更新
This commit is contained in:
parent
5ab38a9077
commit
49c0ec9dd9
@ -25,7 +25,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { provide, reactive, ref, toRaw, watch } from 'vue';
|
||||
import { provide, reactive, ref, toRaw, watch, watchEffect } from 'vue';
|
||||
import cloneDeep from 'lodash-es/cloneDeep';
|
||||
import isEqual from 'lodash-es/isEqual';
|
||||
|
||||
@ -96,6 +96,14 @@ const formState: FormState = reactive<FormState>({
|
||||
},
|
||||
});
|
||||
|
||||
watchEffect(() => {
|
||||
formState.initValues = props.initValues;
|
||||
formState.config = props.config;
|
||||
formState.keyProp = props.keyProp;
|
||||
formState.popperClass = props.popperClass;
|
||||
formState.parentValues = props.parentValues;
|
||||
});
|
||||
|
||||
provide('mForm', formState);
|
||||
|
||||
watch(
|
||||
|
Loading…
x
Reference in New Issue
Block a user