添加 localizeText 方法
This commit is contained in:
parent
fae8ba0c75
commit
c21d397b99
18
index.js
18
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() {
|
||||
|
Loading…
Reference in New Issue
Block a user