罗广辉
2026-04-24 648904d076ae6e17892b40675598b1c8dc474277
src/components/WebViewPlus.vue
@@ -1,15 +1,10 @@
<template>
  <web-view :src="src" @message="viewMessage" :allow="allow"/>
  <!--  #ifdef WEB  -->
  <TUICallKit/>
  <!--  #endif WEB  -->
</template>
<script setup>
// #ifdef WEB
import {TUICallKit} from "@trtc/calls-uikit-vue";
// #endif
const allow = "accelerometer;ambient-light-sensor;autoplay;battery;camera;clipboard-read;clipboard-write;cross-origin-isolated;display-capture;document-domain;encrypted-media;execution-while-not-rendered;execution-while-out-of-viewport;fullscreen;gamepad;geolocation;gyroscope;hid;idle-detection;local-fonts;magnetometer;microphone;midi;payment;picture-in-picture;publickey-credentials-get;screen-wake-lock;serial;speaker-selection;storage-access;sync-xhr;usb;web-share;xr-spatial-tracking"
const src = defineModel("src");
@@ -38,6 +33,13 @@
  }
}
onLoad((obj) => {
  // const h5Params = obj?.cs && JSON.parse(obj?.cs)
  // console.log('h5Params', h5Params)
  // h5Params && viewMessage({detail: {data: [h5Params.data]}})
})
onShow(() => {
  if (window && window.addEventListener)
    window.addEventListener("message", messageFun);