微信获取摄像头+拍照回显

2019-08-01  本文已影响0人  无酒之人
<camera style="width: 100%; height: 450px;"></camera>
takePhoto() {
    const ctx = wx.createCameraContext()
      ctx.takePhoto({
        quality: 'high',
        success: (res) => {
          this.src = res.tempImagePath
          console.log(this.src)
        }
      })
    },
<image mode="widthFix" src="{{src}}"></image>
上一篇 下一篇

猜你喜欢

热点阅读