feature: vor und nachteile

This commit is contained in:
Hikyu
2026-05-31 13:54:31 +02:00
parent 552a947a1c
commit e3dad17446
23270 changed files with 3024794 additions and 200 deletions
+24
View File
@@ -0,0 +1,24 @@
<script setup lang="ts">
import { computed, ref, watchEffect } from 'vue'
const props = defineProps<{
innerHtml: string
}>()
const emit = defineEmits<{
(event: 'shadow', div: ShadowRoot): void
}>()
const el = ref<HTMLDivElement>()
const shadow = computed(() => el.value ? (el.value.shadowRoot || el.value.attachShadow({ mode: 'open' })) : null)
watchEffect(() => {
if (shadow.value && props.innerHtml) {
emit('shadow', shadow.value)
shadow.value.innerHTML = props.innerHtml
}
})
</script>
<template>
<div ref="el" />
</template>