6***@qq.com
6***@qq.com
  • 发布:2024-04-29 16:48
  • 更新:2024-04-30 20:39
  • 阅读:149

图片上传后没有显示出来请问时哪里出错了?

分类:uni-app

<view class="img_content">

                        <view class="img_item"  v-for="(item ,index) in imgs" :key="index" >                                  
                            <image  src="item" mode="aspectFit" class="img_item_img"></image>                 
                            <image src="../../static/images/del.png" mode="" class="img_item_icon" @click="delimg"></image>  
                        </view>  

                        <view class="upload" @click="upload_img(114,2)">  
                            <image src="../../static/images/upload.png" mode=""></image>  
                        </view>  

                    </view>  

upload_img(id, num) {
console.log(id)
console.log(num)

            uni.chooseImage({  
                count: num, //默认9  
                sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有  
                success: function(res) {  
                    console.log(res);  
                    this.imgs =res.tempFilePaths  
                    console.log(imgs)  
                }  
            });  

        },
2024-04-29 16:48 负责人:无 分享
已邀请:
DCloud_UNI_Anne

DCloud_UNI_Anne

<image  :src="item" mode="aspectFit" class="img_item_img"></image>  

uni.chooseImage({  
          count: num, //默认9    
          sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有    
          success: (res)=> {  
            console.log(res);  
            this.imgs = res.tempFilePaths  
            console.log(this.imgs)  
       }  
 });

要回复问题请先登录注册