提交 af2da948 编写于 作者: Q qiang

fix: 修复H5端部分情况document.title不自动更新的问题

上级 34856a1b
......@@ -34,6 +34,9 @@ function setNavigationBar (type, args) {
title
} = args
page.navigationBar.titleText = title
if (__PLATFORM__ === 'h5') {
document.title = title
}
break
}
}
......
......@@ -196,6 +196,9 @@ function afterEach (to, from) {
setTimeout(function () {
callPageHook(toVm, 'onShow')
}, 0)
if (__PLATFORM__ === 'h5') {
document.title = toVm.$parent.$parent.navigationBar.titleText
}
}
}
}
......
......@@ -173,6 +173,11 @@ export default {
navigationBar,
refreshOptions
}
},
created () {
if (__PLATFORM__ === 'h5') {
document.title = this.navigationBar.titleText
}
}
}
</script>
......@@ -383,14 +383,7 @@ export default {
return btns
}
},
watch: {
titleText (newVal, oldVal) {
document.title = newVal
}
},
mounted () {
document.title = this.titleText
if (this.searchInput) {
const input = this.$refs.input
input.$watch('composing', val => {
......
......@@ -31,6 +31,11 @@ export default {
default: false
}
},
created () {
if (__PLATFORM__ === 'h5') {
document.title = this.$slots.default[0].text
}
},
methods: {
_back () {
this.$emit('back')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册