-
Notifications
You must be signed in to change notification settings - Fork 39
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 in Composition API supported? #16
Comments
Well, I just found out how to use it. You have to This is my app.use(Toaster).provide('toast', app.config.globalProperties.$toast); This is my mounted() {
this.$toast.show('Toast from mounted()!');
},
setup(props, context): any {
const toast: any = inject('toast');
toast.show('Toast from setup()!');
} |
Thank you! |
It must be added in documentation here https://vuejsexamples.com/vue-js-toast-notification-plugin-for-vue-3/ |
Thanks @andgeno !! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I tried to use your plugin with Vue 3 and TypeScript but could not make it work.
I added a
.d.ts
file to make TypeScript ignore missing types and just be happy.In my
mina.ts
I addedIn my
App.ts
I am using the Composition API withsetup()
like this:Unfortunately,
this.$toast
is not available because of the Composition API.I checked the docs and searched a lot on the internet but to no avail.
Any idea how to make it work?
The text was updated successfully, but these errors were encountered: