Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how use this countdown in nuxt 3 ? #6

Open
mr-navas opened this issue Aug 14, 2022 · 2 comments
Open

how use this countdown in nuxt 3 ? #6

mr-navas opened this issue Aug 14, 2022 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@mr-navas
Copy link

mr-navas commented Aug 14, 2022

i get error ReferenceError: document is not defined into nuxt3 component

ReferenceError: document is not defined
at addStyle (/home/navas/Desktop/Nuxt/Front-Nuxt/node_modules/vue3-flip-countdown/dist/vue3-flip-countdown.common.js:6434:22)

@coskuncay coskuncay added the help wanted Extra attention is needed label Oct 9, 2022
@zhw2590582
Copy link

I found a way that works with:

<template>
  <ClientOnly>
    <Countdown />
  </ClientOnly>
</template>

<script>
import { defineAsyncComponent } from "vue";

export default {
  components: {
    Countdown: defineAsyncComponent(async () => {
      const { Countdown } = await import("vue3-flip-countdown");
      return Countdown;
    }),
  },
};
</script>

@mohammad-ashrafi2020
Copy link

I found a way that works with:

<template>
  <ClientOnly>
    <Countdown />
  </ClientOnly>
</template>

<script>
import { defineAsyncComponent } from "vue";

export default {
  components: {
    Countdown: defineAsyncComponent(async () => {
      const { Countdown } = await import("vue3-flip-countdown");
      return Countdown;
    }),
  },
};
</script>

this code not worked in production

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants