There was an answer here, but it was deleted. Answer from a person: spyshiv He helped me a lot. So I'll duplicate part of his answer here.
The problem: your current Celll.vue just renders a raw VNode - it doesn't execute the slot with the passed data. You need to call the slot as a function and pass a string as an argument to the slot.
✅ Solution summary: Update Celll.vue to:Accept vnodes (which are actually slots wrapped in a VNode),And render them as a slot function with a passed string.
// TableComponent.vue
<template>
<table>
<tr v-for="(row, rowIndex) in data" :key="rowIndex">
<Celll
v-for="(col, colIndex) in columns"
:key="colIndex"
:slotFn="col.children.default"
:row="row"
/>
</tr>
</table>
</template>
// Celll.vue
<script>
import { h } from 'vue';
export default {
props: {
slotFn: {
type: Function,
required: true,
},
row: {
type: Object,
required: true,
},
},
render() {
return h('td', null, this.slotFn(this.row));
},
};
</script>