diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index 60602fb6c5134aaa2eb18c8cf55cba5e9dec2311..daf42d91007bc0868a50ff38f5ea961d6de23629 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -1,3 +1,10 @@ +## Wip + +### 🐛 Bug Fixes + +- 修复`Description`已知问题 +- 修复`BasicForm`已知问题 + ## 2.0.2 (2021-03-04) ### ✨ Refactor diff --git a/src/components/Form/src/hooks/useForm.ts b/src/components/Form/src/hooks/useForm.ts index 4e592802dbd8e0f00a516ffbbe7c32113098757e..2a421fd6fc41e1c05691b52c0abbe53cc2d48ab8 100644 --- a/src/components/Form/src/hooks/useForm.ts +++ b/src/components/Form/src/hooks/useForm.ts @@ -1,4 +1,4 @@ -import { ref, onUnmounted, unref, nextTick, watchEffect } from 'vue'; +import { ref, onUnmounted, unref, nextTick, watch } from 'vue'; import { isInSetup } from '/@/utils/helper/vueHelper'; import { isProdMode } from '/@/utils/env'; @@ -39,12 +39,18 @@ export function useForm(props?: Props): UseFormReturnType { if (unref(loadedRef) && isProdMode() && instance === unref(formRef)) return; formRef.value = instance; - loadedRef.value = true; - watchEffect(() => { - props && instance.setProps(getDynamicProps(props)); - }); + watch( + () => props, + () => { + props && instance.setProps(getDynamicProps(props)); + }, + { + immediate: true, + deep: true, + } + ); } const methods: FormActionType = {