Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use vue-toaster inside action.js #21

Open
woutervanerp opened this issue May 19, 2021 · 6 comments
Open

Use vue-toaster inside action.js #21

woutervanerp opened this issue May 19, 2021 · 6 comments

Comments

@woutervanerp
Copy link

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?

@meirroth
Copy link

meirroth commented Jun 8, 2021

Hi @woutervanerp, Have you found a solution?

@woutervanerp
Copy link
Author

Nope, i stated using Vue Toastification (for Vue 3).
Which uses:

import { useToast } from 'vue-toastification'

const toast = useToast()

@meirroth
Copy link

Awesome!
Thank you :)

@mesqueeb
Copy link
Contributor

@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.

@baka-san
Copy link

baka-san commented Nov 15, 2021

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
358d6c2

@mesqueeb
Copy link
Contributor

@jprodrigues70 can you double check the npm version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants