城阳工作端公众号前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
574 B

1 year ago
const state = {
1 year ago
userName: '',
tabActive:0,
scrollTop:0
1 year ago
}
const mutations = {
SET_USER_NAME(state, name) {
state.userName = name
1 year ago
},
SET_TAB_ACTIVE(state, num) {
state.tabActive = num
},
SET_SCROLL_TOP(state, num){
state.scrollTop = num
},
1 year ago
}
const actions = {
// 设置name
setUserName({ commit }, name) {
commit('SET_USER_NAME', name)
1 year ago
},
setTabActive({ commit }, num) {
commit('SET_TAB_ACTIVE', num)
},
setScrollTop({ commit }, num){
commit('SET_SCROLL_TOP', num)
1 year ago
}
}
export default {
state,
mutations,
actions
}