mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-03-06 02:11:56 +00:00
refactor: 将 initialValue 写入 field 中
This commit is contained in:
parent
19295bb040
commit
2eeafb1db1
@ -132,6 +132,13 @@ class SettingFieldView extends Component<{ field: SettingField }> {
|
|||||||
value = field.getValue();
|
value = field.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 当前 field 没有 value 值时,将 initialValue 写入 field
|
||||||
|
// 之所以用 initialValue,而不是 defaultValue 是为了保持跟 props.onInitial 的逻辑一致
|
||||||
|
if (value == undefined && initialValue != undefined) {
|
||||||
|
const _initialValue = typeof initialValue === 'function' ? initialValue(field.internalToShellPropEntry()) : initialValue;
|
||||||
|
field.setValue(_initialValue);
|
||||||
|
}
|
||||||
|
|
||||||
let _onChange = extraProps?.onChange;
|
let _onChange = extraProps?.onChange;
|
||||||
let stageName = this.stageName;
|
let stageName = this.stageName;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user