v-lightbox icon indicating copy to clipboard operation
v-lightbox copied to clipboard

window is not defined

Open jumbolpc opened this issue 4 years ago • 2 comments

I have a problem when I'm trying to use it, like the image I attached with link below help me, please! https://i.ibb.co/YLQdMBM/1234567.png How should I do?

jumbolpc avatar Jan 17 '21 07:01 jumbolpc

Hello, are you using it with Nuxt.js? I also had this problem. The solution is for you to install it as a Pluggin in Client / Nossr mode.

luizotavior avatar Feb 16 '21 23:02 luizotavior

For Nuxtjs: I'm on typescript, but on js it's the same.

In nuxtjs.config.ts


 css: [
    '@morioh/v-lightbox/dist/lightbox.css',
  ],

plugins: [
    { src: '~/plugins/v-lightbox.ts', ssr: false },
  ],

In folder plugins: v-lightbox.ts

import Vue from 'vue'
import Lightbox from '@morioh/v-lightbox'

Vue.use(Lightbox)

For typescript I add declare module '@morioh/v-lightbox' on d.ts file

And it's works for me.

sortidocorps avatar Feb 18 '21 19:02 sortidocorps