xinli/xinlidsj/pages/webview/index.vue
2026-02-24 16:49:05 +08:00

37 lines
627 B
Vue

<template>
<view class="page">
<web-view v-if="url" :src="url"></web-view>
<view v-else class="empty">链接为空</view>
</view>
</template>
<script>
export default {
data() {
return {
url: ''
}
},
onLoad(query) {
const url = query && query.url ? decodeURIComponent(query.url) : ''
const title = query && query.title ? decodeURIComponent(query.title) : ''
this.url = url
if (title) {
uni.setNavigationBarTitle({ title })
}
}
}
</script>
<style>
.page {
min-height: 100vh;
background: #ffffff;
}
.empty {
padding: 40rpx;
color: #646a73;
font-size: 28rpx;
}
</style>