XiongAmao / vue-easy-lightbox

A tiny lightbox component for Vue.js 3.0 :tada::tada: https://xiongamao.github.io/vue-easy-lightbox/
MIT License
409 stars 68 forks source link

Import images from local #30

Closed NeutronBlast closed 4 years ago

NeutronBlast commented 4 years ago

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']

XiongAmao commented 4 years ago

Hi, vue-easy-lightbox just receive a string or an array of strings of the image url , and the url of the local image needs to be handled by webpack or comes from other address e.g. http://via.placeholder.com/350x150

I create a demo, you can check the detail here