mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-01 22:09:55 +00:00
26 lines
502 B
Vue
26 lines
502 B
Vue
<template>
|
|
<div ref="container" />
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { onMounted, ref, watch } from 'vue'
|
|
|
|
const props = defineProps<{
|
|
renderFunction: () => HTMLElement
|
|
}>()
|
|
|
|
const container = ref<HTMLElement | null>(null)
|
|
|
|
function renderContent() {
|
|
if (container.value) {
|
|
container.value.innerHTML = ''
|
|
const element = props.renderFunction()
|
|
container.value.appendChild(element)
|
|
}
|
|
}
|
|
|
|
onMounted(renderContent)
|
|
|
|
watch(() => props.renderFunction, renderContent)
|
|
</script>
|