提交 83a34603 编写于 作者: V Vben

fix(form): fix the problem of form props monitoring close #322

上级 ce93e46f
## Wip
### 🐛 Bug Fixes
- 修复`Description`已知问题
- 修复`BasicForm`已知问题
## 2.0.2 (2021-03-04)
### ✨ Refactor
......
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 = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册