小程序
小游戏
企业微信
微信支付
扫描小程序码分享
点击图片上传后选择图片,然后点击打开后,图片不能显示在图片上传那个地方
5 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
哈哈哈哈哈新手嘛?
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
给你个思路
获取本地相册图片--->生成临时地址 ---> 用image 展示临时地址
loadingPic(){ let self = this; wx.chooseImage({ count: 1, sizeType: ['original', 'compressed'], sourceType: ['album', 'camera'], success (res) { // tempFilePath可以作为img标签的src属性显示图片 const tempFilePaths = res.tempFilePaths; console.log(tempFilePaths) self.setData({ imgUrl:tempFilePaths[0] }) } }) },
<view bindtap="loadingPic">获取图片</view> <image src="{{imgUrl}}" mode="widthFix" />
你看这是我的代码,我用真机测试都是可以的,就工具不行
这块需要自己写相关代码完成图片展示哈。
这是要你渲染的铁子,你拿到本地地址后建议上传到网络然后在渲染
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
哈哈哈哈哈新手嘛?
给你个思路
获取本地相册图片--->生成临时地址 ---> 用image 展示临时地址
loadingPic(){ let self = this; wx.chooseImage({ count: 1, sizeType: ['original', 'compressed'], sourceType: ['album', 'camera'], success (res) { // tempFilePath可以作为img标签的src属性显示图片 const tempFilePaths = res.tempFilePaths; console.log(tempFilePaths) self.setData({ imgUrl:tempFilePaths[0] }) } }) },
<view bindtap="loadingPic">获取图片</view> <image src="{{imgUrl}}" mode="widthFix" />
你看这是我的代码,我用真机测试都是可以的,就工具不行
这块需要自己写相关代码完成图片展示哈。
这是要你渲染的铁子,你拿到本地地址后建议上传到网络然后在渲染