import {mapState} from 'vuex'
computed:{
//可解决变量延迟问题
/**username(){
return this.$store.state.username;
},
cartCount(){
return this.$store.state.cartCount;
},*/
...mapState(['username','cartCount']) //与上面的等价
},
05——vue企业级电商系统(vuex)
猜你喜欢
转载自blog.csdn.net/Pandora_417/article/details/105561126
今日推荐
周排行