Closed ldiellyoungl closed 1 year ago
Just so I understand correctly just declaring the composable like:
<script lang="ts" setup>
const $toast = useToast()
</script>
With Nuxt 3 you should do like this instead and be importing from useNuxtApp
<script lang="ts" setup>
import { useNuxtApp } from '#app'
const { $toast } = useNuxtApp()
</script>
You can see an example of this in our Nuxt 3 Template hopefully that helps out
i use const $toast = useToast() in section if i refresh page then document is not defined. but if i use $toast = useToast() in function and execute it toast and modals work is fine. what is my problem? sorry for bad english