I am using $vs.notify
to show message that comes from db. So thought of using it in the actions.js. but getting error as TypeError: Cannot read property 'notify' of undefined
. Is there any way that i could use it in action.js file.
used code is here:
addTag({
commit
}, tag) {
return new Promise((resolve, reject) => {
Vue.prototype.$http.post('/tags/add/', {
tag
})
.then((response) => {
commit('ADD_TAG', Object.assign(response.data.data[0]))
Vue.prototype.$vs.notify({
title: 'Success',
text: `tag-${response.data.data[0].name} added suceesfully`,
iconPack: 'feather',
icon: 'icon-alert-circle',
color: 'success'
})
resolve(response)
})
.catch((error) => {
reject(error)
})
})
}