I am using Vue 3 with Composition API, and I want to use a third-party package (for example @meforma/vue-toaster
), and it should be used like this (in Options API):
import Toaster from '@meforma/vue-toaster';
createApp(App).use(Toaster).mount('#app')
and then in the component:
this.$toast.show(`Hey! I'm here`);
this.$toast.success(`Hey! I'm here`);
this.$toast.error(`Hey! I'm here`);
this.$toast.warning(`Hey! I'm here`);
this.$toast.info(`Hey! I'm here`);
But this
is not working inside the Composition API's setup()
function.