如題,在小程序里打開文件然后查看完文件后返回,小程序頁面刷新了,我現(xiàn)在返回的頁面是個(gè)表單,刷新了表單已填寫的數(shù)據(jù)就沒了。請(qǐng)問一下小程序查看文檔后有不刷新頁面的屬性設(shè)置嗎?
網(wǎng)友回復(fù):
你好,問題未復(fù)現(xiàn)。請(qǐng)?zhí)峁┮幌鲁霈F(xiàn)問題的機(jī)型和微信版本,以及能復(fù)現(xiàn)問題的簡單代碼示例。
你好,所有的機(jī)型都會(huì)有這個(gè)問題呀,我打開了文件之后返回,頁面就刷新了
wx.downloadFile({
url: url,
success: function (res) {
let path = res.tempFilePath
console.log(path)
if(typeof op.title === 'string'){
wx.setNavigationBarTitle({
title: '返回' || op.backText
})
}
wx.openDocument({
filePath: path,
success: function (res) {
if(typeof op.title === 'string'){
wx.setNavigationBarTitle({
title: op.title
});
}
typeof op.success === 'function' && op.success(res);
},
fail: function (err) {
console.log(err)
_this.hideToast('loading')
typeof op.fail === 'function' && op.fail(err)
}
})
},
fail(err) {
typeof op.fail === 'function' && op.fail(err)
}
})