2022-08-01 09:03:10 +00:00
|
|
|
export default {
|
|
|
|
state:{//存放状态
|
|
|
|
token:'token已生成',
|
|
|
|
userInfo:{},
|
2022-08-12 10:14:13 +00:00
|
|
|
ifAutoplay:false ,// 组件轮播是否自动播放
|
2022-08-18 06:22:40 +00:00
|
|
|
fristIn:false,//是否第一次进入
|
|
|
|
cartNum:0//购物车数量
|
2022-08-01 09:03:10 +00:00
|
|
|
},
|
|
|
|
// Vuex中store数据改变的唯一方法就是mutations 不适合异步方法
|
|
|
|
mutations: {
|
2022-08-01 10:18:01 +00:00
|
|
|
setAutoplay(state,str) {
|
|
|
|
state.ifAutoplay = str;
|
2022-08-12 10:14:13 +00:00
|
|
|
},
|
|
|
|
// 设置是否第一次进入
|
|
|
|
setFristIn(state,str) {
|
|
|
|
state.fristIn = str;
|
|
|
|
},
|
2022-08-18 06:22:40 +00:00
|
|
|
// 设置购物车数量
|
|
|
|
setCartNum(state,str) {
|
|
|
|
state.cartNum = str;
|
|
|
|
},
|
2022-08-01 09:03:10 +00:00
|
|
|
}
|
|
|
|
}
|