wx.hideTabBar is not a function;at pages/index/index page lifeCycleMethod onShow function
wx.showTabBar is not a function;at pages/index/index setIsLogined function;at api request success callback function
代码片段:
wywx.js文件
function hideTabBar(success, fail) {
wx.hideTabBar({
aniamtion: false,
success: typeof success == "function" ? success() : function (res) {
console.log("wx.hideTabBar.success");
},
fail: typeof fail == "function" ? fail() : function (res) {
console.log("wx.hideTabBar.fail");
},
complete: function (res) { },
})
}
function showTabBar(success, fail) {
wx.showTabBar({
aniamtion: false,
success: typeof success == "function" ? success() : function (res) {
console.log("wx.showTabBar.success");
},
fail: typeof fail == "function" ? fail() : function (res) {
console.log("wx.showTabBar.fail");
},
complete: function (res) { },
});
}
index.js文件中调用
var w = require("../../utils/mywx.js");
w.showTabBar(function () {
console.log("w.showTabBar")
});
w.hideTabBar();
你好,基础库1.9.0开始支持
楼主问题描述基础库是2.09
这个就需要和楼主确认才行,因为有时候开发者提供的信息有误,这个之前是有遇到过的