As the src properties will replaced by Webpack, you could do require function like this
<templae>
<div>
<img :src="imageUrl">
</div>
</template>
<script>
export default {
props: {
imageUrl: {
type: String,
default: ''
}
}
}
</script>
*ParentComponent.vue
<template>
<ChildComponentExample :image-url="require('~/assets/myimage.png')" />
</template>
Top comments (0)