uni-app在vue生命周期函数onLaunch里判断已经存在用户信息则uni.switchTab跳转到tab页,打包成安卓之后控制台里报i.setStyle is not a function; at wx.switchTab,这种错误不是小程序的错误吗,wx对象怎么会出现在安卓里
App.vue
export default {
onLaunch: function() {
try{
let lacUser = uni.getStorageSync('lacUser') || '';
if (lacUser) {
//this.utils.myAlert('1234')
uni.switchTab({
url: '/pages/index/index'
});
}
console.log('App Launch')
}catch(e){
//this.utils.myAlert(e)
}
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
15:42:34.400 [编译] Compiling...
15:42:35.978 [完成] uni-app 编译完毕
15:42:35.989 项目 'testlac' 编译成功.
15:42:35.999 正在同步手机端程序文件...
15:42:36.249 同步手机端程序文件完成
15:42:36.271 正在重启...
15:42:41.578 appServiceSDKScriptError
15:42:41.598 42:39.469 3356 3356 I console : i.setStyle is not a function; at wx.switchTab
15:42:41.626 42:39.469 3356 3356 I console : TypeError: i.setStyle is not a function
15:42:41.874 App Launch at App.vue:13
15:42:41.894 App Show at App.vue:20
联系方式QQ:1239102496
1***@qq.com (作者)
现在已经解决了,谢谢
2019-01-11 14:01