<template>
    <div class="app-html" v-html="html"></div>
</template>

<script lang="ts" setup>
import { shallowRef } from 'vue'
import axios, { AxiosRequestConfig } from 'axios'

const props = defineProps({
    url: {
        type: String,
        required: true
    },
})

const html = shallowRef()
const config: AxiosRequestConfig = {
    url: props.url,
    method: 'get',
    responseType: 'document',
    responseEncoding: 'utf-8'
}

axios(config).then((res) => {
    html.value = res.data
})
</script>

<style lang="less" scoped>
@import './index.less';
</style>