-
Notifications
You must be signed in to change notification settings - Fork 70
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
Webpack resolve image #27
Comments
Hi,
If this doesn't work, I will definitely check Nuxt.js since this could be a configuration issue |
@saintplay tried what you suggested but no change... I don't think there is problem in Nuxt. As I mentioned this works:
while this doesn't
|
I didn't notice before, but did you pass username as a prop? <avatar
username="Test Profile"
src="~/assets/img/profiles/test.png"
/> |
Yeah I do pass Then I tried removing passing
|
The username is required, the problem here is the path resolution for the image, I will dig into this the weekend for sure. |
I just checked Nuxt documentation https://nuxtjs.org/guide/assets/ <template>
<img src="~/assets/image.png">
</template>
createElement('img', { attrs: { src: require('~/assets/image.png') }}) |
Just in case someone is suffering because of this: <avatar
username="Vader"
:src="require('~/assets/img/vader.png')"
/> Using require will do the job! |
I am trying to add image to the src attribute, but it's not working... How does avatar resolve images? I am working with Nuxt.js which uses Webpack to resolve images.
Does not work
<avatar src="@/assets/img/profiles/test.png">
works
<avatar src="https://eliep.github.io/vue-avatar/static/darth-vader.png">
.If I do this
<img src="@/assets/img/profiles/test.png">
, the image is displayed.Thanks
The text was updated successfully, but these errors were encountered: