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) {
|
||||
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: {},
|
||||
|
@ -103,6 +111,9 @@ export default {
|
|||
$formDefaultValue() {
|
||||
return this.d_value ?? this.$pcFormField?.initialValue ?? this.$pcForm?.initialValues?.[this.$formName];
|
||||
},
|
||||
$formValue() {
|
||||
return this.$pcForm?.states?.[this.$formName]?.value;
|
||||
},
|
||||
controlled() {
|
||||
return this.$inProps.hasOwnProperty('modelValue') || (!this.$inProps.hasOwnProperty('modelValue') && !this.$inProps.hasOwnProperty('defaultValue'));
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue