core/client/components/document/KHtml.vue
<template> <div v-if="html" v-html="html" /></template> <script setup>import { ref, watch } from 'vue'import { Document } from '../../document.js' // Propsconst props = defineProps({ url: { type: String, default: null }, localize: { type: Boolean, default: true }}) // Dataconst html = ref(null) // Watchwatch(() => props.url, async (value) => { const response = await Document.fetchUrl(value, props.localize) if (response?.ok) html.value = Document.sanitizeHtml(await response.text()) else html.value = null}, { immediate: true })</script>