mapActions.ts 417 B

12345678910111213
  1. import { mapActions as _mapActions, createNamespacedHelpers } from 'vuex';
  2. import { useActionMapper } from './useMapper';
  3. /**
  4. * mapAction
  5. * @description 参考 vuex 的 mapAction
  6. * https://vuex.vuejs.org/zh/guide/actions.html#%E5%9C%A8%E7%BB%84%E4%BB%B6%E4%B8%AD%E5%88%86%E5%8F%91-action
  7. */
  8. export const mapActions = (map: {}) => {
  9. let mapperFn = _mapActions;
  10. return useActionMapper(map, mapperFn) as any;
  11. };