diff --git a/pages_tool/vr/index.vue b/pages_tool/vr/index.vue index 2dd6fe5..9fc0e49 100644 --- a/pages_tool/vr/index.vue +++ b/pages_tool/vr/index.vue @@ -1,6 +1,6 @@ @@ -27,17 +27,24 @@ export default { }); }, onShow() { - this.updateNavbarTitle(); + if (this.title) { + uni.setNavigationBarTitle({ title: this.title }); + } }, watch: { title(newVal) { - this.updateNavbarTitle(newVal); + if (newVal) { + uni.setNavigationBarTitle({ title: newVal }); + } } }, methods: { - updateNavbarTitle(newTitle) { - const title = newTitle ?? this.title; - uni.setNavigationBarTitle({title}); + onWebViewLoad() { + if (this.title) { + setTimeout(() => { + uni.setNavigationBarTitle({ title: this.title }); + }, 100); + } } } };