罗广辉
2025-11-11 324270b201031fedaa298bdc873423e442df5993
feat: 一定要写条件编译
2 files modified
9 ■■■■ changed files
src/App.vue 5 ●●●●● patch | view | raw | blame | history
src/components/WebViewPlus.vue 4 ●●●● patch | view | raw | blame | history
src/App.vue
@@ -3,7 +3,9 @@
import {useAppStore, useUserStore} from "@/store";
import {mpUpdate} from "@/utils/index";
import {genTestUserSig} from '@/utils/voiceCallByTX/GenerateTestUserSig.js';
import { TUICallKit, TUICallKitAPI, CallMediaType } from '@trtc/calls-uikit-vue'
// #ifdef H5
import {  TUICallKitAPI } from '@trtc/calls-uikit-vue'
// #endif
const appStore = useAppStore();
const userStore = useUserStore();
@@ -43,7 +45,6 @@
  if (!userId.value) return
  // #ifdef H5
  initVoiceCallFromH5()
  console.log(userId.value)
  // #endif
  // #ifdef APP-PLUS
src/components/WebViewPlus.vue
@@ -1,10 +1,14 @@
<template>
  <web-view :src="src" @message="viewMessage" :allow="allow"/>
  #ifdef H5
  <TUICallKit/>
  #endif
</template>
<script setup>
// #ifdef H5
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");