iOS 下 onLoad 事件中无法拿到页面的查询参数
在页面的 onLoad hook 了一个函数,取页面的查询参数,但是在 iOS 指定版本无法取值,其他版本和 Android 正常。
页面地址: /pages/home/home?code=123
代码:
function sp(fn) { try { return fn(); } catch (e) { return undefined; }} var TestPage = { async onLoad(e) { // blahblah }}var oldLoad = TestPage.prototype.onLoad;TestPage.prototype.onLoad = async function(e) { console.log(sp(() => this.options.code) || sp(() => e.code)); if (oldLoad) { await oldLoad(); }}Page(TestPage) // undefined - iOS 10.0.1// 123 - others |
小程序 SDK 版本: 2.3.2/2.4.1
