Closed Vidhyanandcs closed 3 years ago
Hello,
Yes you can achieve this by exporting your vue instance.
export default new Vue({
router,
store,
render: h => h(App)
}).$mount("#app");
then import from any js file and use it.
import vueInstance from "@/main";
[....]
vueInstance.$notification.error("Produits introuvable");
[...]
I use this method to centralise my error notification from axios configuration and not on each call.
I hope that it helped you.
I have an action which is triggered if an api request throws an error. i would like to take this error message and display them to user from the action. Does such a functionallity exist.