0
"info": {
"core": [{
"name": "User",
"fields": [{
"field": "name",
}, {
"field": "age",
}]
}, {
"name": "Post",
"fields": [{
"field": "title",
}, {
"field": "body",
}, {
"field": "author",
}]
}]
}
どのように構造データをマップできますか。オブジェクト内の配列内のLodashマップ配列
1.
- 名前値
- フィールド
- フィールド値
- フィールド値
2:私は、Webビュー上でこのような何かを達成したいです。
の- 名前値
- フィールド
- フィールド値
- フィールド値
のように...
は、私は次のようになりlodashマップを使用してみましたこれらは良い方法ですか?const info = _.map(info.core, function (value: any) {
const fields = _.map(value.fields, function (fields: any) {
return field;
});
const demo = {
name: name,
fields: fields.join('')
};
return demo;
});
console.log(demo);
などのcreateElementと直接DOMを操作することであろう以下
。解決済み。 –