12345678910111213141516171819202122232425 |
- /**
- * 用于代替components库对vuex的依赖
- */
- import { reactive, readonly } from 'vue'
- import * as actions from './actions'
- const state = reactive({
- accountInfo: {},
- app: {}
- })
- const dispatch = (type, payload) => {
- const action = actions[type]
- if (action) {
- action.bind(this, { state, dispatch })(payload)
- } else {
- Error('type action not found!!')
- }
- }
- export default {
- state: readonly(state),
- dispatch
- }
|