You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@huihongme, I have it working fine on my local machine, can you show the code you're using? Also, have you included a plugin to allow promises to work in vuex actions?
i shall just add, in the component
//myComponet.vue
.
.
.
methods:{
myAjaxCall(){
this.$store.dispatchPromise('MyAction').then(.....) // instead of this.$store.dispatch('MyAction').then(.....)
}
store actions:
delNotes ({dispatch, commit}, id) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, 2000)
})
}
component:
[Vue warn]: Error in event handler for "on-ok": "TypeError: Cannot read property 'then' of undefined"
The text was updated successfully, but these errors were encountered: