罗广辉
2025-10-23 59b961528de1b7c56048751a82f9fb6b6f283278
feat: 配置内嵌权限
1 files modified
6 ■■■■■ changed files
src/components/WebViewPlus.vue 6 ●●●●● patch | view | raw | blame | history
src/components/WebViewPlus.vue
@@ -1,11 +1,12 @@
<template>
  <web-view :src="src" @message="viewMessage" />
  <web-view :src="src" @message="viewMessage" :allow="allow"/>
</template>
<script setup>
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");
const emit = defineEmits(["webMessage"]);
function viewMessage(event) {
  messageFun({
    data: {
@@ -16,6 +17,7 @@
    },
  });
}
// WEB_INVOKE_APPSERVICE
function messageFun(e) {
  if (e.data.type === "WEB_INVOKE_APPSERVICE") {