|
@@ -16,20 +16,20 @@ export const component = {
|
|
|
setup(props: any, { emit, slots }: any) {
|
|
setup(props: any, { emit, slots }: any) {
|
|
|
const formErrorTip = computed(() => reactive<any>({}));
|
|
const formErrorTip = computed(() => reactive<any>({}));
|
|
|
provide('formErrorTip', formErrorTip);
|
|
provide('formErrorTip', formErrorTip);
|
|
|
- const init = (value = props.modelValue) => {
|
|
|
|
|
- Object.keys(value).forEach((item) => {
|
|
|
|
|
|
|
+ const clearErrorTips = (value = props.modelValue) => {
|
|
|
|
|
+ Object.keys(formErrorTip.value).forEach((item) => {
|
|
|
formErrorTip.value[item] = '';
|
|
formErrorTip.value[item] = '';
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const reset = () => {
|
|
const reset = () => {
|
|
|
- init();
|
|
|
|
|
|
|
+ clearErrorTips();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
watch(
|
|
watch(
|
|
|
() => props.modelValue,
|
|
() => props.modelValue,
|
|
|
(value: any) => {
|
|
(value: any) => {
|
|
|
- init(value);
|
|
|
|
|
|
|
+ clearErrorTips(value);
|
|
|
},
|
|
},
|
|
|
{ immediate: true }
|
|
{ immediate: true }
|
|
|
);
|
|
);
|