原始数据 const data = [{ id: , spec: '规格1', rules: [{ rank: , breaks: }, { rank: , breaks: }, { rank: , breaks: } ] }, { id: , spec: '规格2', rules: [{ rank: , breaks: }, { rank: , breaks: }, { rank: , breaks: } ] } ]; 使用 forEach 遍历 function skuFormat(data…