Reputation: 97
src/assets/profile.jpg
<v-img src="../assets/profile.png" aspect-ratio="2.75"></v-img>
not load
I do not work. What is the reason?
By the way,
If you specify img tag src, the image will be output.
Upvotes: 3
Views: 10237
Reputation: 183
This Work for me...
<template>
<img :src=logo>
</template>
<script>
export default {
data: () => ({
logo: require('@/assets/profile.png')
})
}
</script>
Upvotes: 5
Reputation: 3257
First you have to bind your image path to the src
property and then you have to wrap the path in require('@/assets/profile.jpg')
to let webpack know that this is a dependency.
So as mentioned as a comment, change your code to this: <v-img :src="require('@/assets/profile.jpg')" aspect-ratio="2.75" ></v-img>
Upvotes: 8