繁体   English   中英

如何在bootstrap-vue中的“ b-table”组件中使用插槽“ bottom-row”?

[英]How to use the slot “bottom-row” in “b-table” component in bootstrap-vue?

我有一个使用bootstrap-vue b表组件的组件。 我需要创建一个结果行,该行将是每一列的总和。 但是,当我尝试使用底部行作为thead-top时,底部行仅填充第一列,而忽略其余部分。 如何使其像thead-top一样工作?

<b-table
    :items="items"
    :fields="fields"
    responsive="sm"
>
        <template slot="thead-top" slot-scope="data">
            <tr>
                <th colspan="2">&nbsp;</th>
            <th>Type 1</th>
            <th colspan="3">Type 2</th>
            <th>Type 3</th>
        </tr>
    </template>
    <template slot="bottom-row"
          slot-scope="data"
    >
        <tr>
            <th colspan="2">&nbsp;</th>
            <th>Type 1</th>
            <th colspan="3">Type 2</th>
            <th>Type 3</th>
        </tr>
    </template>
</b-table>

我意识到自己做错了。 模板slot =“ bottom-row”中不需要标记。

<template slot="bottom-row"
          slot-scope="data"
>
    <td v-for="(field, i) in data.fields">
         {{ i }}
    </td>
</template>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM