我试图用孩子计算一组对象的重量总和,但是我认为我做错了。我正在尝试使用可搜索的下拉包来显示包裹列表。个人应该能够选择包裹类别并在文本标签中查看所选包裹的总重量。下面是我的代码
包裹类别.js
export const ParcelCategories = [
{
name: "Men's",
id: 0,
children: [
{
name: 'Clothing',
id: 10,
Weight: 4,
},
{
name: 'Shirts',
id: 11,
Weight: 3,
},
{
name: 'Jackets & Coats',
id: 13,
Weight: 2,
},
{
name: 'Hoodie & Sweatshirts',
id: 14,
Weight: 4,
},
{
name: 'Shorts',
id: 15,
Weight: 4,
},
{
name: 'Jeans',
id: 17,
Weight: 2,
},
{
name: 'Sneakers',
id: 18,
Weight: 1,
},
{
name: 'Loafers & Slip-ons',
id: 19,
Weight: 4,
},
]
}
];
阿晨1998
相关分类