Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] rematch支持 #5

Open
nyrf opened this issue Nov 12, 2018 · 0 comments
Open

[Feature Request] rematch支持 #5

nyrf opened this issue Nov 12, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@nyrf
Copy link

nyrf commented Nov 12, 2018

希望可以支持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',
      }

这种写法倒是可以运行

@wuhy wuhy added the enhancement New feature or request label Nov 13, 2018
liujiaor added a commit that referenced this issue Dec 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants