// formStatisticsFoundation.js ,命名空间为formStatisticsFoundation
getters: {
zzStatisticsData(state) {
const statisticsData = state.statisticsData;
const data = [{
name: '企业数',
number: statisticsData.enterpriseNumber
},
{
name: '品种数',
number: statisticsData.varietiesNumber
},
];
return data;
}
}
vue文件中
computed: {
...mapGetters('formStatisticsFoundation',{
zzStatisticsData:'zzStatisticsData'
}),
}