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.
|
|
|
const state = {
|
|
|
|
userName: '',
|
|
|
|
tabActive:0,
|
|
|
|
scrollTop:0
|
|
|
|
}
|
|
|
|
const mutations = {
|
|
|
|
SET_USER_NAME(state, name) {
|
|
|
|
state.userName = name
|
|
|
|
},
|
|
|
|
SET_TAB_ACTIVE(state, num) {
|
|
|
|
state.tabActive = num
|
|
|
|
},
|
|
|
|
SET_SCROLL_TOP(state, num){
|
|
|
|
state.scrollTop = num
|
|
|
|
},
|
|
|
|
}
|
|
|
|
const actions = {
|
|
|
|
// 设置name
|
|
|
|
setUserName({ commit }, name) {
|
|
|
|
commit('SET_USER_NAME', name)
|
|
|
|
},
|
|
|
|
setTabActive({ commit }, num) {
|
|
|
|
commit('SET_TAB_ACTIVE', num)
|
|
|
|
},
|
|
|
|
setScrollTop({ commit }, num){
|
|
|
|
commit('SET_SCROLL_TOP', num)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export default {
|
|
|
|
state,
|
|
|
|
mutations,
|
|
|
|
actions
|
|
|
|
}
|