美文网首页
vue v-bind:src,绑定链接或本地地址

vue v-bind:src,绑定链接或本地地址

作者: Light_shallow | 来源:发表于2018-10-26 10:32 被阅读0次

vue的src 没有绑定的地址,分为两种情况

一、本地地址

    <img src="../../assets/head_0.png" alt="">

二、有链接的地址

     <img src="http://XXXX/aa.png" alt="">

vue的src 通过v-bind动态绑定地址,分为两种情况

一、本地地址

<img v-for="(item,index) in 3" v-bind:src="require(`../../assets/head_${index}.png`)" alt="">

二、有链接的地址

    v-bind:src="'http://XXXXXX/'+item.productListImg"

相关文章

网友评论

      本文标题:vue v-bind:src,绑定链接或本地地址

      本文链接:https://www.haomeiwen.com/subject/tvkktqtx.html