在小程序项目中,使用uni.chooseFile报错【TypeError: e.chooseFile is not a function】(如上图),将新版uni.chooseFile
改成uni.chooseMessageFile
uni.chooseMessageFile({
count: 1,
// type: 'file',
extension: ['.doc','.pdf','.docx'],
success(res) {
let _this = this
uni.downloadFile({
url: _this.imgUrl(path),
success: function(res) {
let filePath = res.tempFilePath
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function(res) {
}
})
}
})
}
});