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

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

Open
asifkhankadiwala opened this issue Aug 8, 2019 · 2 comments

Comments

@asifkhankadiwala
Copy link

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

@MrToxy
Copy link

MrToxy commented Aug 14, 2020

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?

@nor1c
Copy link

nor1c commented Mar 9, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants