| 1234567891011121314151617181920212223242526272829 |
- <template>
- <view class="container">
- <web-view :src="fileUrl" :title="pageTitle"></web-view>
- </view>
- </template>
- <script setup>
- import { ref } from 'vue'
- import { onLoad } from '@dcloudio/uni-app'
- const fileUrl = ref('')
- const pageTitle = ref('文件预览')
- onLoad((options) => {
- fileUrl.value = options.url || ''
- pageTitle.value = options.title || '文件预览'
-
- // 设置导航栏标题
- uni.setNavigationBarTitle({
- title: pageTitle.value
- })
- })
- </script>
- <style scoped>
- .container {
- width: 100%;
- height: 100vh;
- }
- </style>
|