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

v-img not showing image when applying with group on non img element

Open asifkhankadiwala opened this issue 5 years ago • 2 comments

v-img works fine with img tag. But I have requirement to integrate it with font awesome icon so i use v-img="{src:fileslocation,group:groupname}" but it doesn't show image than i remove group from object and it works.

Please solve this bug i have to use group.

Screenshot_4

asifkhankadiwala avatar Aug 08 '19 06:08 asifkhankadiwala

Sad we won't ever get this fixed. however I think I've found the issue, if you look into lib/index.js on lines 128-130 you'll see that he's only querying for img elements and nothing else:

images = [
            ...document.querySelectorAll(`img[data-vue-img-group="${el.dataset.vueImgGroup}"]`),
          ];

I could open a PR to fix this or maybe fork it?

MrToxy avatar Aug 14 '20 18:08 MrToxy

for anyone who facing this issue, you can fix this with:

in lib/index.js image

and in .vue / html file, you should add v-img class, so the package can find which element to read, for example:

<span class="v-img" v-img="{ src: '...', group: 11 }">
   <i ...></i>
</span>

or

<img v-img class="v-img" src="...">

or you can use this https://www.npmjs.com/package/v-img-viewer, I've fixed the issue there, 'cause this repo is no longer maintained by the owner

nor1c avatar Mar 09 '22 09:03 nor1c