| 1234567891011121314151617181920212223242526272829303132333435363738 |
- // 公共模块
- // // #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
- }
|