diff --git a/index.js b/index.js index 21c124c..ba5bc33 100644 --- a/index.js +++ b/index.js @@ -286,13 +286,17 @@ module.exports = { } }, - setBarTitles({ windowTitle, pageTitle } = {}) { - 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 之后,否则会被其覆盖掉。 - // #endif - if (page.$store._mutations['i18n/setTabbar']) page.$store.commit('i18n/setTabbar') // 必须要在有 tab 的页面里重置才有效果 + // setBarTitles({ windowTitle, pageTitle } = {}) { + // 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 之后,否则会被其覆盖掉。 + // // #endif + // if (page.$store._mutations['i18n/setTabbar']) page.$store.commit('i18n/setTabbar') // 必须要在有 tab 的页面里重置才有效果 + // }, + + localizeText(i18nText) { + return i18nText[this.$store.state.i18n.mylang] }, localeText() {