mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-05-17 01:19:18 +08:00
fix(form): 初始化values时,数组中的对象出现key丢失
This commit is contained in:
parent
fd1fea2519
commit
32e86d8167
@ -71,7 +71,7 @@ const initItemsValue = (
|
|||||||
{ items, name, extensible }: any,
|
{ items, name, extensible }: any,
|
||||||
) => {
|
) => {
|
||||||
if (Array.isArray(initValue[name])) {
|
if (Array.isArray(initValue[name])) {
|
||||||
value[name] = initValue[name].map((v: any) => init(mForm, items, v));
|
value[name] = initValue[name].map((v: any, index: number) => init(mForm, items, v, value[name]?.[index]));
|
||||||
} else {
|
} else {
|
||||||
value[name] = init(mForm, items, initValue[name], value[name]);
|
value[name] = init(mForm, items, initValue[name], value[name]);
|
||||||
if (extensible) {
|
if (extensible) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user