分享出去的小程序卡片点开,无pages栈,兼容代码回到首页

This commit is contained in:
Xiaohui Lam
2019-04-12 11:08:50 +08:00
committed by GitHub
parent 1cc9a377c2
commit 85c4809a44

View File

@@ -52,6 +52,10 @@
},
methods: {
BackPage() {
if (getCurrentPages().length < 2 && 'undefined' !== typeof __wxConfig) {
let url = '/' + __wxConfig.pages[0]
return uni.redirectTo({url})
}
uni.navigateBack({
delta: 1
});