纯nvue项目,nvue编译模式为uni-app
描述:在App.vue中读取缓存中设置的参数来判断是否是第一次打开应用,然后跳转到引导页,引导页使用的swiper组件,点击最后一张引导图后跳转到首页,但是跳转到首页后报错:
15:09:31.520 [JS Framework] Failed to execute the callback function:
15:09:31.540 TypeError: Cannot read property '__call_hook' of undefined
15:09:31.560 reportJSException >>>> exception function:WEEX_CALL_JAVASCRIPT, exception:JavaScript execute error!Uncaught TypeError: Cannot read property '__call_hook' of undefined
App.vue中的代码:
onLaunch: function() {
console.log(uni.getStorageSync('isFirstEnter'))
if(uni.getStorageSync('isFirstEnter') === false){
uni.navigateTo({
url: 'pages/guide/guide'
});
}
console.log('App Launch')
}
引导页中的代码:
uni.switchTab({
url:'/pages/index/index',
success() {
uni.setStorageSync('isFirstEnter',false)
}
})
PS:引导页中使用uni.navigateBack也报这个错误
麻烦大神帮忙看看是什么情况
xzh
楼主,有什么解决方法吗
2020-11-12 20:19