const arr = [{
"name": "color",
"options": ["红色", "绿色"]
},
{
"name": "size",
"options": ["s", "m"]
}]
color和size 的key 从name 拿
如何两两组合最后输出下面格式,并希望能通用,比如3个数组的时候。
[{
"price": '',
"stock": '',
"color": "红色",
"size": "s"
},
{
"price": '',
"stock": '',
"color": "红色",
"size": "m"
},
{
"price": '',
"stock": '',
"color": "绿色",
"size": "s"
},
{
"price": '',
"stock": '',
"color": "绿色",
"size": "m"
}]