-
Notifications
You must be signed in to change notification settings - Fork 19
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
How to use with vue-class-component? #10
Comments
You should you spread operators |
@ilajosmanov const Test = Vue.extend({
methods: foo.mapMutations(['inc']),
render(h): any {
return h('div')
}
}) I've tried to use spread, but that didn't help There are no errors thrown from compiler and mutations typings do not work too. |
The example code should work properly. It does not matter whether you use spread operator or not. |
@ktsn |
import { Component, Vue } from 'vue-property-decorator';
import TestStore from './module';
const Super = Vue.extend({
methods: TestStore.mapMutations(['setTest'])
})
@Component
export default class App extends Super {
mounted() {
this.setTest(true);
}
} |
@ktsn I did right as you said, but it doesn't work. But it still works fine in a regular |
That is likely your editor or build environment issue. It does not happen on my side with your reproduction. Please check whether the actual build process passes type check. |
Yes, you were right - there is error, types working. It seems that WebStorm can't recognize that... Sorry for bother you, thanks for help! UPDATE |
…se Typescript won't be able to infer the this type. Link: ktsn/vuex-smart-module#10 (comment)
I'm trying to do something like that:
But got an error:
Argument types do not match parameters
onmapMutations
.The text was updated successfully, but these errors were encountered: