u
This commit is contained in:
parent
37d6867881
commit
a12226c4e2
12
usertool.js
12
usertool.js
@ -62,12 +62,7 @@ export default {
|
|||||||
const mylang = getApp()?.$store?.state?.i18n?.mylang // 不要用 pageNow.$store,防止在 App.vue 里无法获取当前页面。
|
const mylang = getApp()?.$store?.state?.i18n?.mylang // 不要用 pageNow.$store,防止在 App.vue 里无法获取当前页面。
|
||||||
const pageNow = this.thisPage() // 需要兼顾在 App.vue 时无法获取当前页面的情况,因为如果在 topWindow 里调用本函数,getApp() 和 getCurrentPages()[getCurrentPages().length-1] 就是 undefined。
|
const pageNow = this.thisPage() // 需要兼顾在 App.vue 时无法获取当前页面的情况,因为如果在 topWindow 里调用本函数,getApp() 和 getCurrentPages()[getCurrentPages().length-1] 就是 undefined。
|
||||||
|
|
||||||
// #ifdef H5
|
uni.setNavigationBarTitle({ // 也会被用于浏览器的标签标题,因此要用 document.title 去覆盖
|
||||||
document.title =
|
|
||||||
windowTitle || wo?.envar?.Sys_Brand_Name?.[mylang] || pagesJson?.appInfo?.i18nText?.[mylang] || pagesJson?.globalStyle?.navigationBarTitleText // 必须放在 setNavigationBarTitle 之后,否则会被其覆盖掉。
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
uni.setNavigationBarTitle({
|
|
||||||
title:
|
title:
|
||||||
pageTitle ||
|
pageTitle ||
|
||||||
pageNow?.i18nText?.[mylang]?.tPageTitle || // 页面.vue 的 i18nText 对象
|
pageNow?.i18nText?.[mylang]?.tPageTitle || // 页面.vue 的 i18nText 对象
|
||||||
@ -75,6 +70,11 @@ export default {
|
|||||||
pagesJson?.pages?.find((page) => page.path === pageNow?.route)?.i18nPageTitle?.[mylang], // pages.json 的页面配置里
|
pagesJson?.pages?.find((page) => page.path === pageNow?.route)?.i18nPageTitle?.[mylang], // pages.json 的页面配置里
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// #ifdef H5
|
||||||
|
document.title =
|
||||||
|
windowTitle || wo?.envar?.Sys_Brand_Name?.[mylang] || pagesJson?.appInfo?.i18nText?.[mylang] || pagesJson?.globalStyle?.navigationBarTitleText // 必须放在 setNavigationBarTitle 之后,否则会被其覆盖掉。
|
||||||
|
// #endif
|
||||||
|
|
||||||
// 必须要在有 tab 的页面里 setTabBarItem 才有效果
|
// 必须要在有 tab 的页面里 setTabBarItem 才有效果
|
||||||
//const midIndex = parseInt(pagesJson?.tabBar?.list?.length/2) // 如果存在midButton,实际上tabBar.list.length必须为偶数。不过为了心安,再parseInt一下。
|
//const midIndex = parseInt(pagesJson?.tabBar?.list?.length/2) // 如果存在midButton,实际上tabBar.list.length必须为偶数。不过为了心安,再parseInt一下。
|
||||||
pagesJson?.tabBar?.list?.forEach((tab, tabIndex) => {
|
pagesJson?.tabBar?.list?.forEach((tab, tabIndex) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user