Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

How to pass dynamic image url in nuxt project

$
0
0

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.


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>