Initialize the Vue plugin.
For example, for a Vite Vue application
// main.jsimportToastedfrom"@hoppscotch/vue-toasted"import{createApp}from"vue"importAppfrom"./App.vue"// Make sure to include the default stylingsimport"@hoppscotch/vue-toasted/style.css"constapp=createApp(App)app.use(Toasted)// You can pass options as a second parameter
Now you will be able to access vue-toasted in your Vue components.
For Options API:
import{defineComponent}from"vue"exportdefaultdefineComponent({mounted(){// Should give you access to the toasted show functionthis.$toasted.show("Hola! From Options API!")}})
For Composition API:
consttoast=useToasted()toast.show("Hola! From Composition API!")