I'm currently working on a Vuejs component setup that resembles the following structure:
<template>
<button @click="generateItem()">Add item</button>
<div class="container"></div>
</template>
<script setup>
import { h } from 'vue'
import MyItem from '@/components/MyItem.vue'
function generateItem(){
return h(MyItem)
}
</script>
My goal is to utilize the h()
function to render an instance of MyItem
within the div.container
when executing the generateItem()
function. However, despite referencing the official Vuejs documentation on the h()
function, I'm unsure of how to achieve this. Any insights or suggestions on how I can accomplish this task?