| 1 | <script setup lang="ts"> |
| 2 | import { ref, watchEffect } from 'vue' |
| 3 | |
| 4 | const props = defineProps<{ |
| 5 | element: HTMLElement |
| 6 | }>() |
| 7 | |
| 8 | const container = ref<HTMLElement>() |
| 9 | |
| 10 | watchEffect(() => { |
| 11 | if (container.value) |
| 12 | container.value.appendChild(props.element) |
| 13 | }) |
| 14 | </script> |
| 15 | |
| 16 | <template> |
| 17 | <div ref="container" /> |
| 18 | </template> |
| 19 |