【发布时间】:2020-02-14 12:54:11
【问题描述】:
我正在尝试为 bootstrap-vue Table 组件创建一个包装器。该组件使用槽来定义单元格模板,如下所示:
<b-table :items="itemsProvider" v-bind="options">
<template v-slot:cell(id)="data">
///...here goes the template for the cell's of itens key "id"
</template>
</b-table>
所以,我正在创建的包装器是这样的:
<div>
<b-table :items="itemsProvider" v-bind="options" >
<slot></slot>
</b-table>
<b-pagination
v-model="currentPage"
:total-rows="rows"
:per-page="perPage"
/>
</div>
我想这样调用这个组件:
<TableAjax :options="options">
<template v-slot:cell(id)="data">
///...here goes the template for the cell's of itens key "id"
</template>
</TableAjax>
但是,由于 b-table 组件上所需的插槽已命名,我很难从包装器中传递它。
我该怎么做?
【问题讨论】:
标签: javascript vue.js vuejs2 bootstrap-vue