fumeapp / tailvue

Vue components built for Nuxt3|Vue3 powered by Windi CSS|tailwindcss
157 stars 14 forks source link

Error when using $modal in nuxt 3 ( document is not defined ) #34

Open OmarHegazi94 opened 1 year ago

OmarHegazi94 commented 1 year ago

nuxt version: 3.7.4 OS: Windows 10

Hello, I'm getting this error after i followed the installation proccess mensioned in docs. after running: npm install --save-dev @nuxtjs/tailwindcss npm install --include=dev @tailvue/nuxt nuxt.config.ts: modules: [ ..., '@nuxtjs/tailwindcss', '@tailvue/nuxt' ],

[id].vue: ( script setup ) ` import { useModal } from 'tailvue' const $modal = useModal()

function openModal() { $modal.show({ type: "danger", title: "This is the title property", body: "This is the body property.", primary: { label: "Primary Action", theme: "red", action: () => $toast.show("Primary Button clicked"), }, secondary: { label: "Secondary Action", theme: "white", action: () => $toast.show("Clicked Secondary"), }, }); } `

[id].vue: (template) <button type="button" class="btn btn-primary" @click="openModal">Launch demo modal</button>

image

fatihtkale commented 1 year ago

im getting this with $toast

FrazeColder commented 8 months ago

Any news? How can I solve this?