vue-toaster
vue-toaster copied to clipboard
Use vue-toaster inside action.js
For a project i'm using vuex actions.
Inside the .js file i get the error: TypeError: Cannot read property '$toast' of undefined
How do i solve this issue?
Hi @woutervanerp, Have you found a solution?
Nope, i stated using Vue Toastification (for Vue 3). Which uses:
import { useToast } from 'vue-toastification'
const toast = useToast()
Awesome! Thank you :)
@woutervanerp @meirroth It's now possible to import vue-toaster anywhere (js files, vuex, ...) and use it.
Explained in the updated readme: https://github.com/MeForma/vue-toaster#import
Please close this issue if this solves what you were trying to do.
Is this latest version (1.3.0) not available via Yarn? It seems only up to 1.2.2 is available, yet GitHub has up to 1.3.0.
https://www.npmjs.com/package/@meforma/vue-toaster https://github.com/MeForma/vue-toaster/commit/358d6c24d62219df1c3a3445298fdf86c45a0696
@jprodrigues70 can you double check the npm version?