Open MelvinSnijders opened 2 years ago
I have been up and running for the last few days with this fix in place and do not have any side effects to report. I would like to see this change merged.
I found a solution.
Create your own composable and then use it the same way as described in the docs. Just make sure that vue-toastification/nuxt is added to modules in nuxt.config.js so it's injected into useContext().app.
Add these:
./nuxt.config.js
modules: [
'vue-toastification/nuxt',
]
./composables/useToast
import { useContext } from '@nuxtjs/composition-api'
export const useToast = () => useContext().app.$toast
Usage:
import { useToast } from '@/composables/useToast'
// in setup()
const toast = useToast()
// use toast the same way as described in the docs
Description
Removed export keyword from the
useToast()
method.Related Issue
335
Types of changes
Checklist: