不用 getCurrent.Pages().pop() 而是用 index 来存取

This commit is contained in:
陆柯 2020-10-17 18:47:17 +08:00
parent dcdf12a15b
commit d15c63c716

View File

@ -242,7 +242,7 @@ module.exports = {
},
setBarTitles({ windowTitle, pageTitle } = {}) {
let page = this.$store ? this : getCurrentPages().pop()
let page = this.$store ? this : getCurrentPages()[getCurrentPages().length - 1]
uni.setNavigationBarTitle({ title: pageTitle || page.i18nText[page.$store.state.i18n.mylang].tPageTitle })
// #ifdef H5
document.title = windowTitle || page.$store.getters['i18n/getAppName'] // 必须放在 setNavigationBarTitle 之后,否则会被其覆盖掉。
@ -251,7 +251,7 @@ module.exports = {
},
localeText() {
let page = this.$store ? this : getCurrentPages().pop()
let page = this.$store ? this : getCurrentPages()[getCurrentPages().length - 1]
return page.i18nText[page.$store.state.i18n.mylang]
},