请问微信小程序,将以下代码绑定到view组件上,点击上传图片后为什么报错upLoadImage: function(event) { var id = event.currentTarget.id var that = this wx.chooseImage({ count: 1, sizeType: ['original', 'compressed'], sourceType: ['album', 'camera'], success: function(res) { var tempFilePaths = res.tempFilePaths wx.uploadFile({ url: '/wx/upload', filePath: tempFilePaths[0], name: 'image_file', success: function (res) { } }) }, }) }错误代码是:uploadFile:fail Cannot read property '0' of null感觉是tempFilePaths参数没有传入uploadFile函数中,但是函数中不是应该能读取外层函数的变量吗?
添加回答
举报
0/150
提交
取消