Fixed initial value issue in form components
parent
f8e55a2296
commit
fbb0131b7e
|
@ -63,6 +63,12 @@ export default {
|
|||
handler(newValue) {
|
||||
this.formField = this.$pcForm?.register?.(newValue, this.formControl) || {};
|
||||
}
|
||||
},
|
||||
$formDefaultValue: {
|
||||
immediate: true,
|
||||
handler(newValue) {
|
||||
this.d_value !== newValue && (this.d_value = newValue);
|
||||
}
|
||||
}
|
||||
},
|
||||
formField: {},
|
||||
|
@ -90,6 +96,9 @@ export default {
|
|||
$formName() {
|
||||
return this.formControl?.name || this.name;
|
||||
},
|
||||
$formDefaultValue() {
|
||||
return this.d_value ?? this.$pcForm?.initialValues?.[this.$formName];
|
||||
},
|
||||
uncontolled() {
|
||||
return this.defaultValue !== undefined && this.modelValue === undefined;
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue