0👍
Yes, it’s possible, but complicated. You will need to manually process your slots and render them again using Vue Render Functions.
Check for example this How to clear "Slot ‘default’ invoked outside of the render function" warning? Vue3, Composition API on how to process passed slots in a component.
It’s a lot of work. I would suggest you rethink your design.
Check how popular Vue Libraries, like Quasar, Vuetify, PrimeVue, Element+ design the Tables.
They mostly pass data to a table component and provide slots for cells.
- [Vuejs]-Why does Vue.js not update variables inside data
- [Vuejs]-Best practice of structuring data in a vue app
0👍
For Vue 2 it’s possible using v-bind="" and example:
<slot name="tbod`enter code here`y" v-bind="{ checkbox: true }"></slot>
and add a field using the id, similar this:
<td v-if="checkbox">
<input type="checkbox" :value="employee.id" v-model="selectedEmployees">
</td>
and add a selectedEmployees data property to store all the selected employee IDs
Source:stackexchange.com