Giter VIP home page Giter VIP logo

vue-easy-lightbox's Introduction

vue-easy-lightbox

A Vue.js 3.0 image lightbox component with Zoom / Drag / Rotate / Switch .

npm npm npm

English | 中文文档 | Homepage

[email protected] only supports Vue.js 3, if you need Vue.js 2 version please check here.

Installation

Package managers

$ npm install --save vue-easy-lightbox@next
# OR
$ yarn add vue-easy-lightbox@next

Direct Download

Include the CDN link in HTML.

<script src="https://unpkg.com/vue@next"></script>
<script src="https://unpkg.com/vue-easy-lightbox@next/dist/vue-easy-lightbox.umd.min.js"></script>
<script>
  const app = Vue.createApp({
    // ... root component options
  })
  app.use(VueEasyLightbox) // global variable
  app.mount('#app')
</script>

Different Builds

Since Vue 3.x uses ES2015 (docs faq), there is no need to build ES5 bundle, and ES5 build is removed from version 1.6.0.

Module Filename
UMD(for browsers) vue-easy-lightbox.umd.min.js
CommonJS vue-easy-lightbox.common.min.js (pkg.main)
ES Module(for bundlers) vue-easy-lightbox.esm.min.js (pkg.module)

External CSS Build

Added in: v1.2.3

By default, CSS is included in dist/*.min.js. In some special cases you may want to import CSS individually to avoid some problems (CSP Violation). You can import builds without CSS and individual .css file from dist/external-css/.

import VueEasyLightbox from 'vue-easy-lightbox/external-css'
// or
import VueEasyLightbox from 'vue-easy-lightbox/dist/external-css/vue-easy-lightbox.esm.min.js'

// you need to import css
import 'vue-easy-lightbox/external-css/vue-easy-lightbox.css'
// or
import 'vue-easy-lightbox/dist/external-css/vue-easy-lightbox.css'

TypeScript Checking error:

If your project is TypeScript project and you get this error message:

Could not find the declaration file for module 'vue-easy-lightbox/dist/external-css/vue-easy-lightbox.esm.min.js'

Here are two ways to solve it.

Way 1: add d.ts in your project:

declare module 'vue-easy-lightbox/dist/external-css/vue-easy-lightbox.esm.min.js' {
  import VueEasyLightbox from 'vue-easy-lightbox'
  export * from 'vue-easy-lightbox'
  export default VueEasyLightbox
}

Way 2: alias

If you're using webpack: webpack alias docs

// wepback.config.js
module.exports = {
  //...
  resolve: {
    alias: {
      'vue-easy-lightbox$': 'vue-easy-lightbox/dist/external-css/vue-easy-lightbox.esm.min.js',
    },
  },
};

// in your component
import VueEasyLightbox from 'vue-easy-lightbox' // work

Or vitejs: vitejs alias

// vite.config.js
import { defineConfig } from 'vite'

export default defineConfig({
  resolve: {
    alias: {
      'vue-easy-lightbox$': 'vue-easy-lightbox/dist/external-css/vue-easy-lightbox.esm.min.js'
    }
  }
})

Usage

Using UMD in browser

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <script src="https://unpkg.com/vue@next"></script>
    <script src="https://unpkg.com/vue-easy-lightbox@next/dist/vue-easy-lightbox.umd.min.js"></script>
  </head>
  <body>
    <div id="app">
      <div class="">
        <div v-for="(src, index) in imgs" :key="index" class="pic" @click="() => showImg(index)">
          <img :src="src" />
        </div>
      </div>
      <vue-easy-lightbox :visible="visibleRef" :imgs="imgs" :index="indexRef" @hide="onHide"></vue-easy-lightbox>
    </div>
    <script>
      const { ref } = Vue
      const app = Vue.createApp({
        setup() {
          const visibleRef = ref(false)
          const indexRef = ref(0)
          const imgs = [
            'https://via.placeholder.com/450.png/',
            'https://via.placeholder.com/300.png/',
            'https://via.placeholder.com/150.png/',
            { src: 'https://via.placeholder.com/450.png/', title: 'this is title' }
          ]
          const showImg = (index) => {
            indexRef.value = index
            visibleRef.value = true
          }
          const onHide = () => visibleRef.value = false
          return {
            visibleRef,
            indexRef,
            imgs,
            showImg,
            onHide
          }
        }
      })
      // Registering VueEasyLightbox for your VueApp.
      app.use(VueEasyLightbox)
      app.mount('#app')
    </script>
  </body>
</html>

Register VueApp component

import Vue from 'vue'
import VueEasyLightbox from 'vue-easy-lightbox'

const app = Vue.createApp({
  // ... app options
})
app.use(VueEasyLightbox)
app.mount('#app')

Basic Usage in SFC

<template>
  <div>
    <button @click="showSingle">Show single picture.</button>
    <button @click="showMultiple">Show a group of pictures.</button>

    <vue-easy-lightbox
      :visible="visibleRef"
      :imgs="imgsRef"
      :index="indexRef"
      @hide="onHide"
    ></vue-easy-lightbox>
  </div>
</template>

<script>
// If VueApp is already registered with VueEasyLightbox, there is no need to register it here.
import VueEasyLightbox from 'vue-easy-lightbox'
import { ref, defineComponent } from 'vue'

export default defineComponent({
  components: {
    VueEasyLightbox
  },
  setup() {
    const visibleRef = ref(false)
    const indexRef = ref(0) // default 0
    const imgsRef = ref([])
    // Img Url , string or Array of string
    // ImgObj { src: '', title: '', alt: '' }
    // 'src' is required
    // allow mixing

    const onShow = () => {
      visibleRef.value = true
    }
    const showSingle = () => {
      imgsRef.value = 'http://via.placeholder.com/350x150'
      // or
      // imgsRef.value  = {
      //   title: 'this is a placeholder',
      //   src: 'http://via.placeholder.com/350x150'
      // }
      onShow()
    }
    const showMultiple = () => {
      imgsRef.value = [
        'http://via.placeholder.com/350x150',
        'http://via.placeholder.com/350x150'
      ]
      // or
      // imgsRef.value = [
      //   { title: 'test img', src: 'http://via.placeholder.com/350x150' },
      //   'http://via.placeholder.com/350x150'
      // ]
      indexRef.value = 0 // index of imgList
      onShow()
    }
    const onHide = () => (visibleRef.value = false)

    return {
      visibleRef,
      indexRef,
      imgsRef,
      showSingle,
      showMultiple,
      onHide
    }
  }
})
</script>

Use vue slot custom buttons or toolbar

<vue-easy-lightbox ...>
  <template v-slot:prev-btn="{ prev }">
    <button @click="prev">show the prev</button>
  </template>

  <template v-slot:next-btn="{ next }">
    <button @click="next">show the next</button>
  </template>

  <template v-slot:close-btn="{ close }">
    <button @click="close">close lightbox</button>
  </template>

  <template v-slot:toolbar="{ toolbarMethods }">
    <button @click="toolbarMethods.zoomIn">zoom in</button>
    <button @click="toolbarMethods.zoomOut">zoom out</button>
    <button @click="toolbarMethods.rotateLeft">Anticlockwise rotation</button>
    <button @click="toolbarMethods.rotateRight">clockwise rotation</button>
  </template>
</vue-easy-lightbox>

Reference: Slots

Composables

Added in v1.7.0

useEasyLightbox provides some simple methods and states to help you use setup(). It is optional. You can customize your state.

Usage:

<template>
  <div>
    <button @click="show">show</button>
    <vue-easy-lightbox
      :visible="visibleRef"
      :imgs="imgsRef"
      :index="indexRef"
      @hide="onHide"
    />
  </div>
</template>

<script>
import { defineComponent } from 'vue'
import VueEasyLightbox, { useEasyLightbox } from 'vue-easy-lightbox'

export default defineComponent({
  components: {
    VueEasyLightbox
  },
  setup() {
    const {
      // methods
      show, onHide, changeIndex,
      // refs
      visibleRef, indexRef, imgsRef
    } = useEasyLightbox({
      // src / src[]
      imgs: [
        'http://via.placeholder.com/250x150',
        'http://via.placeholder.com/300x150',
        'http://via.placeholder.com/350x150'
      ],
      // initial index
      initIndex: 0
    })

    return {
      visibleRef,
      indexRef,
      imgsRef,
      show,
      onHide
    }
  }
})
</script>

Type declaration

export interface Img {
  src?: string
  title?: string
  alt?: string
}
export interface UseEasyLightboxOptions {
  /**
   * image src/Img or list of images src/Img
   * @default ''
   */
  imgs: Img | string | (Img | string)[];
  /**
   * initial index of imgList
   * @default 0
   */
  initIndex?: number;
}
export declare const useEasyLightbox: (options: UseEasyLightboxOptions) => {
  imgsRef: Ref<Img | string | (Img | string)[]>;
  indexRef: Ref<number | undefined>;
  visibleRef: Ref<boolean>;
  show: (index?: Ref<number> | number | Event) => void;
  onHide: () => void;
  changeIndex: (index?: number) => void;
};

Options

Props

Name Type Default Description
visible Boolean required Control lightbox display
imgs String/String[]/ImgObject:{ src: string, title?: string, alt?: string }/ImgObject[] required Image's src / array of src / ImgObject:{ src, title?, alt? } / array of ImgObject / array of ImgObject.
index Number 0 Index of imgList
loop Boolean false Pass true to enable continuous loop mode.
scrollDisabled (scroll-disabled) Boolean true Pass true to disable scrolling when modal is visible.
escDisabled (esc-disabled) Boolean false By default, press the esc key to close Modal during presentation.
moveDisabled (move-disabled) Boolean false Pass true to disable image movement and enable swipe.
rotateDisabled (rotate-disabled) Boolean false Pass true to disable image rotation.
zoomDisabled (zoom-disabled) Boolean false Pass true to disable image zooming.
pinchDisabled (pinch-disabled) Boolean false Pass true to disable pinching.
maskClosable (mask-closable) Boolean true Enable or disable click mask to close vue-easy-lightbox.
dblclickDisabled (dblclick-closable) Boolean false Enable or disable double-click on img to zoom in/out.
teleport string | Element - Specify the mount node for vue-easy-lightbox.
swipeTolerance (swipe-tolerance) Number 50 Specify the number of pixel you have to swipe.
zoomScale Number 0.12 Specify the step between zoom levels.
maxZoom Number 3 Specify the maximum level of zoom scale.
minZoom Number 0.1 Specify the minimum level of zoom scale.
rtl Boolean false support RTL (right to left) languages

Event

Name Description Return Value
hide When you click modal mask or close Btn, component will emit this event -
on-error Image loading error event (event.target is not the image to be displayed)
on-prev /
on-prev-click
Emit when prev btn is clicked or when the user swiped right (oldIndex, newIndex)
on-next /
on-next-click
Emit when next btn is clicked or when the user swiped left (oldIndex, newIndex)
on-index-change Emit when imgs's index is changed (oldIndex, newIndex)
on-rotate Emit when image rotate deg: number (clockwise angle deg)

Slot & Scoped Slot

Slot Name Slot Props Slot Props Type Description
prev-btn prev Function Show the prev img
next-btn next Function Show the next img
close-btn close Function Close modal
toolbar toolbarMethods: { zoomIn, zoomOut, rotate(rotateLeft), rotateLeft, rotateRight } { Function } Zoom in, zoom out, rotate(rotateLeft), rotateLeft, rotateRight
loading - - Loading icon
onerror - - Error Placeholder

License

MIT

vue-easy-lightbox's People

Contributors

amal-qb avatar grunghi avatar kevinsimard avatar lochawala avatar lucasferreiralimax avatar matiyeu avatar schweinebaer avatar xiongamao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vue-easy-lightbox's Issues

圖片拖拉效果

先感謝作者提供這麼好的套件,上次提問的onerror圖片也有更新了,真的是非常非常感謝。

另外想請問目前支援手機拖拉圖片的功能了嗎?

看起來目前圖片僅能放大 但如果碰到比較長的圖片 放大後會無法往右或往左滑動看到詳細的圖片內容。

Error in render: "TypeError: Cannot read property 'src' of undefined"

Hi
I use vue-easy-lightbox component inside Vue module and it works perfectly. When I open modal with product data from the shop, when clicking on the image vue-easy-lightbox component activates and shows image. As we know Bootstrap4 modal uses global data and not local inside v-for loop that lists products.

Problem is that every time I activete lightbox component by clicking image in modal, Chrome Dev tools console shows an error from the headline. Looks like src is the problem because it is 'undefined'.

I experimented and switched parts of code that contain src attribute but problem appears only when vue-easy-lightbox component is enabled. Here is the code.

<vue-easy-lightbox :visible="visible" :imgs="imgs" :index="index" @hide="handleHide"></vue-easy-lightbox>

And the rest of the vue-easy-lightbox code is here:

showSingle() {  
     this.imgs = '/images/' + this.raw[this.mIndex].product_img;  // path is OK
     this.show();
},
show() {  // show enlarged image
     this.visible = true;
},
handleHide() {  // hide image enlargement
      this.visible = false;
}

I entered rest of the code exactly as per instructions in your page and looks like that doesn't generate error. I wonder which 'src' generates the problem.

Forgotten vue-easy-lightbox.es5.common.min.js in v0.4.1

Hi!
in package.json "main": "dist/vue-easy-lightbox.es5.common.min.js",
but actually this file not exist at tag v.0.4.1.
This is the reason of error while reload page

Error during render : /xxxxxxx/application
{ Error: Cannot find module 'vue-easy-lightbox'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at r (/home/xxxx/xxxx/xxxxxxx/node_modules/vue-server-renderer/build.dev.js:9303:16)
at Object.vue-easy-lightbox (webpack:/external "vue-easy-lightbox":1:0)
at webpack_require (webpack/bootstrap:25:0)

We use vuestorefront https://www.vuestorefront.io/

Please fix it or add new tag 0.5.0 because only 0.4.1 present

Best regards

P.S. It was happend because I manually check tag at github repository and add in my package.json
as "vue-easy-lightbox": "^0.4.1"

When add your module by 'npm install ... ' or 'yarn add ...' all works fine.

The picture is blurry.

image

The top image is an easy-lightbox image.
The image below is when the same picture is opened directly
This is the image you see.
Why does the image in the lightbox look blurry?
All sizes are 100%.

Can not work with quasar(v2) SSR

I use import to import VueEasyLightbox on SFC.

<template>
  <q-page class="row items-center justify-evenly">
    <vue-easy-lightbox
      escDisabled
      moveDisabled
      :visible="visible"
      :imgs="imgs"
      :index="index"
      @hide="visible = !visible"
    ></vue-easy-lightbox>
    <q-btn @click="visible = !visible">test</q-btn>
    {{ $route.params }}
  </q-page>
</template>

<script lang="ts" setup>
import { ref } from 'vue';
import VueEasyLightbox from 'vue-easy-lightbox';

const imgs = ref([
  { title: 'test img', src: 'http://via.placeholder.com/350x150' },
  'http://via.placeholder.com/350x150',
]);
const index = ref(1);

const visible = ref(false);
</script>

<style scoped lang="scss"></style>

At the beginning, it works. but if refresh the page with VueEasyLightbox . page will crash with error follow:

Couldn't resolve component "default" at "/shots/:platform"

Here is my routes:

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    component: () => import('layouts/MainLayout.vue'),
    children: [
      {
        path: '/',
        component: () => import('pages/Index.vue'),
      },
      {
        path: '/test',
        component: () => import('pages/Test.vue'),
      },
      {
        path: '/shots/:platform',
        component: () => import('pages/shots/Shots.vue'),
        // component: Shots,
      },
      {
        path: '/videos/:platform',
        component: () => import('pages/videos/Videos.vue'),
      },
    ],
  },
  // Always leave this as last one,
  // but you can also remove it
  {
    path: '/:catchAll(.*)*',
    component: () => import('pages/Error404.vue'),
  },
];

And error on console is Window not defined, i guess maybe is use the window too early

ReferenceError: window is not defined
    at Object.<anonymous> (D:\Git\Tahiti\node_modules\vue-easy-lightbox\dist\vue-easy-lightbox.es5.common.min.js:1:29255)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14)
    at Module.require (node:internal/modules/cjs/loader:1013:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at _require (D:\Git\Tahiti\node_modules\@quasar\ssr-helpers\lib\create-bundle.js:56:9)
    at Object.vue-easy-lightbox (render-app.js:1792:18)
    at __webpack_require__ (render-app.js:1827:42)
[Quasar Dev Webserver] /shots/ps4 -> error during render
Error: Couldn't resolve component "default" at "/shots/:platform"
    at D:\Git\Tahiti\node_modules\vue-router\dist\vue-router.cjs.js:2016:47

If you need more information. Here is repository.

btw, VueEasyLightbox is very nice.

Loop prop for Vue 2.0

I'd very much like the recently released loop prop to also work for Vue 2. I've currently built a "hack" by listening to keyboard keys whether it is left or right arrow to change the index, but it would be very much appreciated if the loop prop is also available for Vue 2.

TODO 2021

  • Prevent scroll chaning
  • Refactor to compotion api
  • New docs
  • i18n
  • Accessibility
  • Common Options
  • Fix docs typo
  • Fix Incorrect Demo
  • Support for Vue3 tsx event types
  • css classname
  • Enhance the gesture experience on the mobile device. #63
  • Replace VuePress to VuePress2 or VitePress

description text

Hi, is possible add a description text under the bottom of each image?

Problem requested 2 times

Why do you ask twice when switching images?

Even if I look at the demo site, I ask for it twice.

A 1MB file consumes 2MB of traffic.

If you pass the image, the request enters twice, doubling the traffic
Is it intended?
Is it a bug?

Couldn't it be modified to request only once?

Does not work on Firefox mobile

The page change does not work on Firefox mobile

Tested with
Firefox : 68.7.0
Firefox Nightly : 77.0a1
vue-easy-lightbox : 0.10.3

TODO

  • Custom toolbar/btns/ options #5
  • Description text #9
  • Rewrite class name
  • New document ( vuePress ?)
  • Mobile support #4
  • Minimize bundle size #12
  • Provide es5 / es6+ #12
  • Img loading.
  • escape pressing
  • TypeScript support
  • Rewrite to TypeScript
  • Minize TypeScript build size (with babel)
  • Customize Styles support
  • Error handler
  • Refactor with tsx
  • btn click event & index change event

How to show images in center of screen?

I have many images in block
When I click one of images, an image doesn't shows in center of screen
I need an image to be sxactly in center of screen vertically even If I scroll page to bottom and clikc on last image.
How to show images in center of screen?
Is there something that I can change with CSS?

<div class="works">
      <div
        class="image"
        v-for="(image, index) in images"
        :key="index"
        @click="showSingleImage(index)"
      >
        <img :src="image" :alt="index"/>
      </div>
    </div>
    <client-only>
      <vue-easy-lightbox
        :visible="visible"
        :index="index"
        :imgs="images"
        @hide="visible = false"
      />
    </client-only>

Video

Changing index via props

Hey!

I'm now developing an app, with your library and have no ability to change index via :index property after slider was initialized. To do that I've had to use $refs.onPrev/NextClicked.

using it produces a script 1002 syntax error in Internet Explorer 11

We are using the library in our project. All nice and fine in Chrome, Firefox but produces a script 1002 syntax error in Internet Explorer 11.

We are not doing anything special, just using import VueEasyLightbox and then using it in a component.

Anyone else has encountered this issue? Any ideas?

Note: this happens for all versions: 11, 12.1 and 13.

[FR] Video support

Hi,

do you have on your roadmap plans to add video support (video tag or youtube/vimeo)?

thank you

Toolbar Methods

Hi, in the documentation regarding custom toolbar you mention:

<template v-slot:toolbar="{ toolbarMethods }">
    <button @click="toolbarMethods.zoomIn">zoom in</button>
    <button @click="toolbarMethods.zoomOut">zoom out</button>
    <button @click="toolbarMethods.rotateLeft">Anticlockwise rotation</button>
    <button @click="toolbarMethods.rotateRight">clockwise rotation</button>
  </template>

The question that I'm having is, where should the toolbarMethods come from?
Can I import the default implementation somehow, and just configure the visuals?
Can you provide an example of how this should be used?

zoom in zoom out issue

when we full zoom out then after image is rotate and zoom in work as zoom out and zoom out as zoom in (in short alternative work) #2

Lightbox is not Working with Bootstrap

I'm not sure why it's not working with Bootstrap.

When I remove import ('Bootstrap.css) its working fine while my custom stylesheet still there.

Any help would be much appreciated

Thanks

How can we implement this with objects, instead of array?

Template:

<section class="page media-board"> <div v-for="(images, index) in mediaWallImages" :key="index" :class="images.size" :style="{backgroundImage:url(${images.img})}" @click="() => showImg(index)" /> <VueEasyLightbox :visible="visible" :imgs="images.img"??? :index="index" @hide="handleHide" /> </section>

Data:

mediaWallImages: [ { id: 1, // img: require("@/assets/main/subscribe_bg.png"), img: "https://via.placeholder.com/1000x660/50575D/fff.png?text=1000x600|Media_Wall_01", title: "Customised Local Manufacturing", size: "nor" }, { id: 2, img: "https://via.placeholder.com/1000x660/50575D/fff.png?text=1000x600|Media_Wall_02", title: "Customised Local Manufacturing", size: "tall" }

Method:

showImg(index) { this.index = index; this.visible = true; }, handleHide() { this.visible = false; }

d.ts for Vue.js 3.0

I customized the components's d.ts file in Vue.js 2.0.
In the current version, the correct d.ts does not seem to be exported when using rollup-vue-plugin.
If anyone has experience with typescript , welcome PR. 😏😏

CSP Violation

Снимок экрана 2021-08-02 в 15 20 44
Снимок экрана 2021-08-02 в 15 23 03

This package is inlining css, which violates my CSP rules (default-src 'self'). I know I can enable unsafe-inline but this is unsafe and kinda defeats the purpose.

Is it possible to bundle this package in some other way?

Accessibility: Component is not keyboard navigable and missing labels

Currently this component is not navigable by keyboard. The simplest way to fix this is to make any clickable control a button element (including the images that trigger the lightbox, though that might be a change in documentation more than code).

All the icon toolbars also need a text description (aria-label) describing what it does. In order to make it fully translateable you might want to expose a way to configure the messages (possibly via a vue-i18n)

Support for Video

It will be nice if you enable support to video url (youtube, mp4 urls)

Object(…) is not a function

Hello I got a problem when use yarn add vue-easy-lightbox to auto install and my version is "vue-easy-lightbox": "^1.0.0-rc.1" and use import VueLazyload from 'vue-lazyload'; on main.js, it got a error that Object(…) is not a function, but when I use yarn add [email protected] is work normally.

Final, I'd like to thx author to make this package. Star+100000

Import images from local

Hi, is there a way to import images locally instead of typing a link from the internet? I've tried the following and noone of these worked so I'm wondering if it's really possible or I must host the images online

this.imgs = ["require(../../assets/all-work/1.png)", 'http://via.placeholder.com/350x150']

this.imgs = ['../../assets/all-work/1.png', 'http://via.placeholder.com/350x150']

this.imgs = ['@/assets/all-work/1.png', 'http://via.placeholder.com/350x150']

Nuxt example doesn't work with "vue-easy-lightbox": "^1.0.0-rc.3"

Nuxt example works with "vue-easy-lightbox": "^0.11.0", but I get the following warnings(which breaks the plugin) with the version "vue-easy-lightbox": "^1.0.0-rc.3".
I noticed that for vue 2 and 3 there is different import in ~/plugins but both of them gave me these warnings and project did not load correctly (images unclickable).
You can reproduce this by updating nuxt demo's version to "vue-easy-lightbox": "^1.0.0-rc.3"

|  WARN  Compiled with 12 warnings
|  WARN  in ./node_modules/vue-easy-lightbox/dist/vue-easy-lightbox.es5.esm.min.js
| "export 'Transition' (imported as 's') was not found in 'vue'
|
|  WARN  in ./node_modules/vue-easy-lightbox/dist/vue-easy-lightbox.es5.esm.min.js
| "export 'createBlock' (imported as 'n') was not found in 'vue'
|
|  WARN  in ./node_modules/vue-easy-lightbox/dist/vue-easy-lightbox.es5.esm.min.js
| "export 'createCommentVNode' (imported as 'i') was not found in 'vue'
|
|  WARN  in ./node_modules/vue-easy-lightbox/dist/vue-easy-lightbox.es5.esm.min.js
| "export 'createTextVNode' (imported as 'u') was not found in 'vue'
|
|  WARN  in ./node_modules/vue-easy-lightbox/dist/vue-easy-lightbox.es5.esm.min.js
| "export 'createVNode' (imported as 'r') was not found in 'vue'
|
|  WARN  in ./node_modules/vue-easy-lightbox/dist/vue-easy-lightbox.es5.esm.min.js
| "export 'defineComponent' (imported as 't') was not found in 'vue'
|
|  WARN  in ./node_modules/vue-easy-lightbox/dist/vue-easy-lightbox.es5.esm.min.js
| "export 'openBlock' (imported as 'e') was not found in 'vue'
|
|  WARN  in ./node_modules/vue-easy-lightbox/dist/vue-easy-lightbox.es5.esm.min.js
| "export 'renderSlot' (imported as 'a') was not found in 'vue'
|
|  WARN  in ./node_modules/vue-easy-lightbox/dist/vue-easy-lightbox.es5.esm.min.js
| "export 'resolveComponent' (imported as 'o') was not found in 'vue'
|
|  WARN  in ./node_modules/vue-easy-lightbox/dist/vue-easy-lightbox.es5.esm.min.js
| "export 'toDisplayString' (imported as 'f') was not found in 'vue'
|
|  WARN  in ./node_modules/vue-easy-lightbox/dist/vue-easy-lightbox.es5.esm.min.js
| "export 'withCtx' (imported as 'l') was not found in 'vue'
|
|  WARN  in ./node_modules/vue-easy-lightbox/dist/vue-easy-lightbox.es5.esm.min.js
| "export 'withModifiers' (imported as 'c') was not found in 'vue'

Originally posted by @suruaku in #38 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.