Files
lucky_shop/pages_tool/vr/index.vue
ZF sun dbc6002248 fix(vr page): optimize navigation bar title setting logic
add optional chaining to safely access res.data.title,
only set navigation bar title when title exists, fallback to default removed
2026-07-25 08:50:43 +08:00

46 lines
653 B
Vue

<template>
<view :style="themeColor" class="vr-page">
<web-view :src="src" class="vr-webview"></web-view>
</view>
</template>
<script>
export default {
data() {
return {
src: ''
};
},
onLoad(option) {
this.$api.sendRequest({
url: '/api/config/defaultvr',
success: res => {
if (res.code == 0) {
if (res.data?.title) {
uni.setNavigationBarTitle({
title: res.data.title
});
}
this.src = res.data.url
}
},
fail: res => {
}
});
}
};
</script>
<style lang="scss">
.vr-page {
height: 100vh;
width: 100%;
background: #fff;
}
.vr-webview {
width: 100%;
height: 100%;
}
</style>