I have a component called "List" which contains a vue boostrap table:
<template>
<div>
<b-table :items="items">
<!--<template slot="createdAt" slot-scope="row"> usually vue boostrap table row templates live here-->
<!--{{row.item.createdAt|dateFormatter}}-->
<!--</template>-->
<slot name="tableTemplates"></slot> <!-- but i want to pass the templates from my parent template -->
</b-table>
</div>
</template>
I'm passing the table items from my parent Component "Orders". I also want to pass row templates to the vue boostrap b-table component.
Unfortunately i can't get it to work using slots (That would be a template inside a template)
<template>
<div>
<list :items="items">
<template slot="tableTemplates">
<!--templates inside templates do not work-->
<template slot="id" slot-scope="row">
<span v-b-tooltip.hover :title="row.item.id">{{row.item.id|uuidFormatter}}</span>
</template>
<template slot="createdAt" slot-scope="row">
{{row.item.createdAt|dateFormatter}}
</template>
<template slot="customer" slot-scope="row">
{{row.item.customer}}
</template>
</template>
</list>
</div>
</template>
template
s? – Sam Holmes