1234567891011121314151617181920212223242526272829303132333435363738 |
- <template>
- <view v-if="params.url">
- <web-view :webview-styles="webviewStyles" :src="`${params.url}`"></web-view>
- </view>
- </template>
- <script setup>
- import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
- import { ref, onMounted, inject, shallowRef, reactive, getCurrentInstance } from "vue";
- const props = defineProps({
- // 数据
- src: {
- type: [String],
- default: null,
- },
- });
- const data = reactive({
- params: {},
- webviewStyles: {
- progress: {
- color: "#FF3333",
- },
- },
- });
- const { params, webviewStyles } = toRefs(data);
- onLoad((event) => {
- params.value = event;
- if (event.title) {
- uni.setNavigationBarTitle({
- title: event.title,
- });
- }
- });
- </script>
|