| 123456789101112131415161718192021222324252627282930 |
- export default {
- namespace: 'refresh',
- state: {
- contactList: false,
- client: false,
- company: false,
- longle: false,
- department: false,
- staffList: false,
- business: false
- },
- // 用于处理异步操作和业务逻辑,由action触发,但不能修改state
- effects: {
- //
- *commitAction({ payload }, { put }) {
- yield put({
- type: 'changState',
- payload
- })
- }
- },
- reducers: {
- changState(state, action) {
- return {
- ...state,
- [action.payload]: !state[action.payload]
- }
- }
- }
- }
|