Form: reset not working, changed value not update input (#6767)
* 6755 - update input value after form reset * code refactoring * fix: select button * cleanuppull/7055/head
parent
32daa566d1
commit
7925d86aa3
|
@ -72,6 +72,14 @@ export default {
|
||||||
handler(newValue) {
|
handler(newValue) {
|
||||||
this.d_value !== newValue && (this.d_value = newValue);
|
this.d_value !== newValue && (this.d_value = newValue);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
$formValue: {
|
||||||
|
immediate: false,
|
||||||
|
handler(newValue) {
|
||||||
|
if (this.$formName !== undefined && this.$pcForm?.states?.[this.$formName] && newValue !== this.d_value) {
|
||||||
|
this.d_value = newValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
formField: {},
|
formField: {},
|
||||||
|
@ -103,6 +111,9 @@ export default {
|
||||||
$formDefaultValue() {
|
$formDefaultValue() {
|
||||||
return this.d_value ?? this.$pcFormField?.initialValue ?? this.$pcForm?.initialValues?.[this.$formName];
|
return this.d_value ?? this.$pcFormField?.initialValue ?? this.$pcForm?.initialValues?.[this.$formName];
|
||||||
},
|
},
|
||||||
|
$formValue() {
|
||||||
|
return this.$pcForm?.states?.[this.$formName]?.value;
|
||||||
|
},
|
||||||
controlled() {
|
controlled() {
|
||||||
return this.$inProps.hasOwnProperty('modelValue') || (!this.$inProps.hasOwnProperty('modelValue') && !this.$inProps.hasOwnProperty('defaultValue'));
|
return this.$inProps.hasOwnProperty('modelValue') || (!this.$inProps.hasOwnProperty('modelValue') && !this.$inProps.hasOwnProperty('defaultValue'));
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue