Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vue.js 按钮未显示在表内BootstrapVue_Vue.js_Bootstrap Vue - Fatal编程技术网

Vue.js 按钮未显示在表内BootstrapVue

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-

我试图在单元格“Actions”中添加一个按钮,但是按钮本身没有显示在表中

<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版本的项目上运行良好。