[update] 修改bug80925

This commit is contained in:
lideqin
2024-01-17 18:06:53 +08:00
parent 6390412a97
commit b70f5416dd
3 changed files with 33 additions and 5 deletions
+9 -3
View File
@@ -4,7 +4,7 @@
<van-nav-bar
v-if="hasNavBar"
:class="{'white-style': isWhiteNavBar}"
:title="pageTitle"
:title="specialTitle || pageTitle"
:left-text="hasBack ? $t('back') : ''"
:left-arrow="hasBack"
:right-text="isChinese ? $t('chinese') : $t('english')"
@@ -12,7 +12,7 @@
@click-right="handleChangeLang"
/>
<div class="scroll-box" :class="{'no-nav-bar': !hasNavBar}">
<router-view />
<router-view @titleChange="titleChange" />
</div>
</div>
</a-locale-provider>
@@ -33,7 +33,8 @@ export default {
data () {
return {
currentLang: ZH,
local: zh_CN
local: zh_CN,
specialTitle: '' // 需要特别处理的标题
}
},
created () {
@@ -73,10 +74,15 @@ export default {
},
watch: {
pageTitle (val) {
this.specialTitle = ''
this.changeTitle(val)
}
},
methods: {
titleChange (value) {
this.specialTitle = value
this.changeTitle(value)
},
// 返回上一层
handleBack () {
this.$router.go(-1)