webview.vue 284 B

123456789101112131415
  1. <template>
  2. <web-view :src="url"></web-view>
  3. </template>
  4. <script setup>
  5. import {
  6. ref
  7. } from 'vue'
  8. import {
  9. onLoad
  10. } from '@dcloudio/uni-app';
  11. const url = ref('');
  12. onLoad((options) => {
  13. url.value = decodeURIComponent(options.url || ''); // 解码传递的URL
  14. });
  15. </script>