Answer the question
In order to leave comments, you need to log in
Synchronizing return type Vuex module and action?
export default class LayoutDefault extends Vue {
@user.Action
public emailTest!: (test: string) => void
// or?
public emailTest!: (test: string) => Promise<object>
public mounted(): void {
console.log(this.emailTest('test2')); // Promise в любом случае
@MutationAction
public async emailTest(test: string): Promise<object> {
return {email: test};
}
@Mutation
public setEmail(email: string): void {
this.email = email
}
@Action
public updateName(email: string): void {
this.context.commit('setEmail', email)
}
@user.Action
public emailTest!: (test: string) => Promise<object>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question