index.vue
926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<template>
<view class="webview-container">
<!-- Navigation Header -->
<NavHeader title="计划书" />
<!-- WebView Content -->
<web-view :src="url" class="webview-content" />
</view>
</template>
<script setup>
import { ref } from 'vue'
import { useLoad } from '@tarojs/taro'
import NavHeader from '@/components/navigation/NavHeader.vue'
/**
* WebView Page
* @description 用于显示外部网页内容的页面
*/
const url = ref('')
useLoad((options) => {
// 从页面参数中获取 URL,如果没有则使用默认值
url.value = decodeURIComponent(options.url || 'https://www.google.com')
console.log('WebView URL:', url.value)
})
</script>
<script>
export default {
name: 'WebViewIndex'
}
</script>
<style lang="less" scoped>
.webview-container {
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
}
.webview-content {
flex: 1;
width: 100%;
}
</style>