上次把 setBarTitles 迁移到 i18n.js 后水土不服,在 app 里无法读取正确的当前页面,所以改成都显性传入 pageTitle 参数
This commit is contained in:
		
							parent
							
								
									07b77a252f
								
							
						
					
					
						commit
						5089c10493
					
				@ -219,7 +219,7 @@ module.exports = {
 | 
				
			|||||||
    let page = this.$store ? this : getCurrentPages().pop()
 | 
					    let page = this.$store ? this : getCurrentPages().pop()
 | 
				
			||||||
    uni.setNavigationBarTitle({ title: pageTitle || page.i18nText[page.$store.state.i18n.mylang].tPageTitle })
 | 
					    uni.setNavigationBarTitle({ title: pageTitle || page.i18nText[page.$store.state.i18n.mylang].tPageTitle })
 | 
				
			||||||
    // #ifdef H5
 | 
					    // #ifdef H5
 | 
				
			||||||
    document.title = windowTitle || page.$store.getters['i18n/getAppName'] || page.appName // 必须放在 setNavigationBarTitle 之后,否则会被其覆盖掉。
 | 
					    document.title = windowTitle || page.$store.getters['i18n/getAppName'] // 必须放在 setNavigationBarTitle 之后,否则会被其覆盖掉。
 | 
				
			||||||
    // #endif
 | 
					    // #endif
 | 
				
			||||||
    if (page.$store._mutations['i18n/setTabbar']) page.$store.commit('i18n/setTabbar') // 必须要在有 tab 的页面里重置才有效果
 | 
					    if (page.$store._mutations['i18n/setTabbar']) page.$store.commit('i18n/setTabbar') // 必须要在有 tab 的页面里重置才有效果
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user