uni-app 百度小程序在 Vue.prototype 挂函数无效 点击tabbar跳转报错

uni-app 百度小程序在 Vue.prototype 挂函数无效 点击tabbar跳转报错

操作步骤:

  • 运行示例项目至hbx 3.1.4 百度小程序 即可复现

预期结果:

  • Vue.prototype.xxx = function () {} 可以使用并点击tabbar跳转页面无报错

实际结果:

  • Vue.prototype.xxx = function () {} 不能使用并点击tabbar跳转页面有报错

bug描述:

  • 在 hbx 3.1.2、3.1.3、3.1.4 中都有此问题:
  • 在 hbx 3.1.2、3.1.3、3.1.4 中都有此问题:
    • Vue.filter(‘xxx’, function () {}) 页面上使用无效,3.0.7 无问题
  • 在hbx 3.0.7、3.1.2、3.1.3、3.1.4 中点击tabbar 都报错:
    • [Lifecycle Fail] call Page.onTabItemTap method fail:
    • Cannot read property ‘onTabItemTap’ of undefined
    • TypeError: [Lifecycle Fail] call Page.onTabItemTap method fail:
    • Cannot read property ‘onTabItemTap’ of undefined

下载testBaidu.zip


更多关于uni-app 百度小程序在 Vue.prototype 挂函数无效 点击tabbar跳转报错的实战教程也可以访问 https://www.itying.com/category-93-b0.html

10 回复

顶一下

更多关于uni-app 百度小程序在 Vue.prototype 挂函数无效 点击tabbar跳转报错的实战教程也可以访问 https://www.itying.com/category-93-b0.html


顶一下

顶一下

顶一下, 或许我是透明的,

其他小程序是否正常?

正常

隔了段时间迭代小程序,打开百度的小程序就出现了
index.js:1 [Lifecycle Fail] call Page.onTabItemTap method fail: Cannot read property ‘onTabItemTap’ of undefined TypeError: [Lifecycle Fail] call Page.onTabItemTap method fail: Cannot read property ‘onTabItemTap’ of undefined
排查了一下,发现之前的百度小程序基础库设置的是3.200.1,在最新的3.260.37基础库就出现这问题 比较严重的是tabBar的页面,会出现页面样式错乱,数据不展示,打开的新窗口页部分出现js报错信息

顶一下

顶一下

报错的问题应该是百度小程序的 bug,相关反馈:https://smartprogram.baidu.com/forum/topic/show/127459
数据未显示的问题已 3.1.6+ 已修复

回到顶部