How can I use vue’s v-html
directive in a Vue 3 <script setup>
environment without an extra wrapping tag?
I want to be able to do something like this:
<script setup>
const html = ref(`<pre></pre>`)
</script>
<template v-html="html"></template>
This code does work, but a 2-3 second delay can be observed when this approach is taken which is not ideal.
<script setup>
const html = ref(`<pre></pre>`)
</script>
<template>
<template v-html="html"></template>
</template>
Is there a way we could create some kind of fragment component?