I want to pass image url to child component but image is not showing.
I tried v-attr
, :attr
, :src
properties.
pages/index.vue
<ThumbNail img-url="assets/img/igsim_intro.png"/>
components/Thumbnail.vue
<!-- Failed to resolve directive: attr --><img v-attr="imgUrl" /> <!-- 404 Not found: http://localhost:3000/assets/img/pds_main.png --><img :src="imgUrl" /><img :attr="{src: imgUrl}" />
<script>export default { name: "ThumbNail", props: { imgUrl: { type: String, default: '' } }}</script>
I expect Thumbnail.vue
show images as passed url.