You need to sign in or sign up before continuing.
index.vue 926 Bytes
<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>