如何直接从本地上传图片

问题遇到的现象和发生背景

怎么可以从本地直接上传多个图片,并且排版成九宫格的

用代码块功能插入代码,请勿粘贴截图

wxml的

<button bindtap="xuanze">选择图片button>
<view wx:for="{{pics}}">
<image src="{{ima}}" mode="aspectFit" style="margin-top: 10px;" alt=""/>
view>


js里的

    data: {
ima:"https://img2.baidu.com/it/u=3883278396,2797261079&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=281",
   
    
    },
xuanze(){
    var that=this
    wx.chooseImage({
      count: 3,
      success(res){
      console.log(res.tempfilePaths)
      that.setData({
          pics:res.tempFilePaths
      })
      }
      
    })
},

运行结果及报错内容

img


只能显示同一张图片

我想要达到的结果

可以直接从本地插入图片,形成九宫格

这个地方改成src="{{item}}"才会显示上传的图片

img