// 公共模块 // // #ifdef H5 // const prefix = '/api' // // #endif // // #ifndef H5 // const prefix = '' // // #endif const state = { pattern: uni.getStorageSync('pattern') || 'light', } const getters = { pattern: state => state.pattern } const actions = { changePattern(context, data) { context.commit("setPattern", data); } } const mutations = { setPattern(state, data) { state.pattern = data; uni.setStorageSync('pattern', data) }, } export default { state, mutations, actions, getters }