有处于状态的对象的对象(默认为空),我想放置具有以下结构的对象:
product {
id: ... ,
name: ... ,
manufacturer_id: ... ,
manufacturer_name ...
}
处于状态中的对象内部。因此最终结构应如下所示:
productsList {
[manufacturer_id] {
manufacturer_name: ...,
products {
[product_id] {
name: ... ,
},
[product_id] {
name: ... ,
},
[product_id] {
name: ... ,
}
}
},
[manufacturer_id] {
manufacturer_name: ... ,
products {
[product_id] {
name: ... ,
}
}
}
}
最简单的方法是什么?