Vue.js 按钮未显示在表内BootstrapVue
我试图在单元格“Actions”中添加一个按钮,但是按钮本身没有显示在表中Vue.js 按钮未显示在表内BootstrapVue,vue.js,bootstrap-vue,Vue.js,Bootstrap Vue,我试图在单元格“Actions”中添加一个按钮,但是按钮本身没有显示在表中 <template> <ContentWrapper> <div class="content-heading">Audit Trails</div> <div class="my-table" > <!-- BOOTSTRAPVUE TABLE --> <b-
<template>
<ContentWrapper>
<div class="content-heading">Audit Trails</div>
<div class="my-table" >
<!-- BOOTSTRAPVUE TABLE -->
<b-form-input
v-model="filter"
type="search"
placeholder="Search"
>
</b-form-input>
<b-table striped hover style="cursor: pointer"
:items="items"
:fields="config"
:currentPage="currentPage"
:perPage="perPage"
:filter="filter"
@row-clicked="modal"
:key="items.name">
<!-- Adds new cell in table called Actions, inside the cell is the buttons -->
<template v-slot:cell(actions)>
<b-button v-b-modal.modal-1>DELETE</b-button>
</template>
</b-table>
<!-- Modal -->
<b-modal ref="mymodal" title="BootstrapVue">
<p class="my-4">Hello from modal!</p>
</b-modal>
<b-modal id="modal-1" title="BootstrapVue">
<p class="my-4">Modal!</p>
</b-modal>
<!-- Pagination -->
<b-pagination
v-model="currentPage"
:total-rows="rows"
:per-page="perPage"
></b-pagination>
</div>
</ContentWrapper>
</template>
审计跟踪
删除
你好,来自莫代尔
模态
Vue版本:2.6.10
BootstrapVue版本:bootstrap-vue@2.0.0-rc.21表格中的这一评论不准确 在名为Actions的表中添加新单元格,单元格内是按钮 使用
字段
道具时,必须传递模板中使用的字段名。将操作
字段添加到配置
数组:
config: ['id','name','actions','etc']
如果您没有使用字段
道具,那么在数据项中有一个操作
字段就足够了
无论哪种方式,该字段都不能由模板创建。是的,我在配置数组中已经有了操作。但按钮仍然没有显示。事实证明,我使用的bootstrapvue项目版本已经过时(版本2.0.0)。该代码在版本为2.20.0的其他项目上运行良好。无论如何,谢谢你的帮助:)!我还没有尝试更新版本,但我认为更新它会解决问题,因为代码在其他具有最新bootstrapvue版本的项目上运行良好。