mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
feat(form): number组件初始值尝试统一转换成number
This commit is contained in:
parent
959638c2c5
commit
554bc4b5c1
@ -122,7 +122,11 @@ const initValueItem = function (
|
|||||||
// 这种情况比较多,提前结束
|
// 这种情况比较多,提前结束
|
||||||
if (name && !items && typeof initValue[name] !== 'undefined') {
|
if (name && !items && typeof initValue[name] !== 'undefined') {
|
||||||
if (typeof value[name] === 'undefined') {
|
if (typeof value[name] === 'undefined') {
|
||||||
value[name] = typeof initValue[name] === 'object' ? cloneDeep(initValue[name]) : initValue[name];
|
if (type === 'number') {
|
||||||
|
value[name] = Number(initValue[name]);
|
||||||
|
} else {
|
||||||
|
value[name] = typeof initValue[name] === 'object' ? cloneDeep(initValue[name]) : initValue[name];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user