小程序PDF web-view组件 在线预览 苹果手机可以 华为手机不可以 鸿蒙系统不可以
解决办法如下
微信官方提供先下载再预览
wx.downloadFile({
// 示例 url,并非真实存在
url: 'http://example.com/somefile.pdf',
success: function (res) {
const filePath = res.tempFilePath
wx.openDocument({
filePath: filePath,
success: function (res) {
console.log('打开文档成功')
}
})
}
})