mirror of
http://112.124.100.131/happyinsurance_eco/ebiz-sunful-eco-web.git
synced 2025-12-09 02:46:54 +08:00
refactor(growth-guard):优化数据转换逻辑- 简化 groups 数据转换逻辑,使用 map代替 filter + map- 移除冗余的 console.log语句-修复 customers 数据更新的赋值方式
This commit is contained in:
@@ -69,13 +69,11 @@ export default {
|
||||
// 将groups数据转换为多维数组格式
|
||||
const convertedGroups = newValue.map(group => {
|
||||
// 从每个group的data中提取name属性组成数组
|
||||
// 排除空的
|
||||
return group.data.filter(item => item.name).map(item => item.name)
|
||||
// return group.data.map(item => item.name || '')
|
||||
})
|
||||
console.log(convertedGroups)
|
||||
return group.data.map(item => item.name || '');
|
||||
});
|
||||
|
||||
// 更新customers数据,用于footer显示
|
||||
this.customers = convertedGroups
|
||||
this.customers = convertedGroups;
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user