vuex 获取数据

首先在组件中引入 import {mapstate,mapGetters} from vuex

获取vuex中的数据一般写在computed(计算)中

computed : {

  ...mapState(['user']),

  ...mapGetters(['productGuest'])

}

详情参看https://blog.csdn.net/a3060858469/article/details/80717824

猜你喜欢

转载自www.cnblogs.com/cs122/p/9782904.html
今日推荐