一、前提
已经做过:
1.懒加载路由
https://blog.csdn.net/qq_43540219/article/details/107671446
2.store.js的传值和localStorage的本地存储
https://blog.csdn.net/qq_43540219/article/details/107692393
二、 Home.vue:
import {mapState} from 'vuex'
computed:{
...mapState(["cityName"])
},
if(item.city==That.cityName){//当前选择的城市与data中对应数据匹配
//再将取到的接口中的数据分别存入对应数组
That.spikeList = item.spikeList;
That.likeList = item.likeList;
}