mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-24 02:00:25 +08:00
fix(form): fix the problem of form props monitoring close #322
This commit is contained in:
parent
ce93e46faf
commit
83a3460356
@ -1,3 +1,10 @@
|
|||||||
|
## Wip
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
- 修复`Description`已知问题
|
||||||
|
- 修复`BasicForm`已知问题
|
||||||
|
|
||||||
## 2.0.2 (2021-03-04)
|
## 2.0.2 (2021-03-04)
|
||||||
|
|
||||||
### ✨ Refactor
|
### ✨ Refactor
|
||||||
|
@ -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 { isInSetup } from '/@/utils/helper/vueHelper';
|
||||||
import { isProdMode } from '/@/utils/env';
|
import { isProdMode } from '/@/utils/env';
|
||||||
@ -39,12 +39,18 @@ export function useForm(props?: Props): UseFormReturnType {
|
|||||||
if (unref(loadedRef) && isProdMode() && instance === unref(formRef)) return;
|
if (unref(loadedRef) && isProdMode() && instance === unref(formRef)) return;
|
||||||
|
|
||||||
formRef.value = instance;
|
formRef.value = instance;
|
||||||
|
|
||||||
loadedRef.value = true;
|
loadedRef.value = true;
|
||||||
|
|
||||||
watchEffect(() => {
|
watch(
|
||||||
props && instance.setProps(getDynamicProps(props));
|
() => props,
|
||||||
});
|
() => {
|
||||||
|
props && instance.setProps(getDynamicProps(props));
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true,
|
||||||
|
deep: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const methods: FormActionType = {
|
const methods: FormActionType = {
|
||||||
|
Loading…
Reference in New Issue
Block a user