import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) const store = new Vuex.Store({ // 全局变量定义 state: { mainColor: '#ff6e3e', // 主色 customStyle: { // 底部悬浮按钮样式 height: '40px', fontSize: '14px', backgroundColor: '#ff6e3e' }, handleCustomStyle: { // 卡片主要操作按钮样式 backgroundColor: '#ff6e3e', fontSize: '11px', padding: '0 15px' }, handleDefaultCustomStyle: { // 卡片普通操作按钮样式 color: '#ff6e3e', fontSize: '11px', padding: '0 15px', borderColor: '#ff6e3e', }, }, mutations: { // 例子 test(state, provider) { // state.mainColor = ''; } }, getters: { mainColor: state => { return state.mainColor }, customStyle: state => { return state.customStyle }, handleCustomStyle: state => { return state.handleCustomStyle }, handleDefaultCustomStyle: state => { return state.handleDefaultCustomStyle }, } }) export default store