网络编程 
首页 > 网络编程 > 浏览文章

Vue 中对图片地址进行拼接的方法

(编辑:jimmy 日期: 2024/5/8 浏览:3 次 )

拿到一组数据,其中的img地址是这样的

Vue 中对图片地址进行拼接的方法

我们想要将它转化为正常的图片地址,需要使用for循环来将图片拼接起来

 getSingList(){
  getSingerList().then((res) =>{
   if (res.code==ERR_ok){
   this.singers=res.data.list
   console.log(this.singers)
   for(var i=0;i<this.singers.length;i++){
    this.singers[i].Fsinger_mid='//y.gtimg.cn/music/photo_new/T001R300x300M000'+this.singers[i].Fsinger_mid+'.jpg"htmlcode">
 <ul class="singerPosti">
  <li v-for="item in sortList" class="singerConten">
  <div class="avatar">
  <img :src="/UploadFiles/2021-04-02/item.Fsinger_mid">

Vue 中对图片地址进行拼接的方法

以上这篇Vue 中对图片地址进行拼接的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

上一篇:react在安卓中输入框被手机键盘遮挡问题的解决方法
下一篇:VUE预渲染及遇到的坑