<template>
  <web-view 
    class="w-100 h-100vh"
    :src="finalUrl"
    @error="onError"
  />
</template>

<script setup lang="ts">
import { useLoadQuerys } from '@/common/composeabe/LoadQuerys';
import { ref } from 'vue';

const finalUrl = ref('')
const { querys } = useLoadQuerys({
  url: '',
}, ({ url }) => {
  finalUrl.value = decodeURIComponent(url)
  console.log('web-view', finalUrl.value)
});

function onError(e: any) {
  console.error('web-view error', e)
  uni.showToast({
    title: '打开网页失败',
    icon: 'none',
  })
}
</script>