Skip to content

[Feature Request] rematch支持 #5

@nyrf

Description

@nyrf

希望可以支持rematch, 现在写rematch可以用,就是直接写一个方法

inc () {
  this.$store.dipatch.count.increment()
}

computed 倒是没问题,actions写法,原生的redux写法用rematch好像不行,我自己简单改了下extend/redux里的这里

   toAction && Object.keys(toAction).forEach(k => {
        let act = toAction[k];
        toAction[k] = function (...args) {
            // this.$store.dispatch(act.apply(null, args));
            this.$store.dispatch({type: act, payload: args});

        };
    });

然后用

    actions: {
          'inc': 'count/increment',
          'dec': 'count/decrement',
          'up': 'count/up',
          'addToCart': 'cart/add',
      }

这种写法倒是可以运行

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions