【问题标题】:vue bootstrapTable cannot click v-on:clickvue bootstrapTable 无法点击 v-on:click
【发布时间】:2021-10-05 00:58:30
【问题描述】:

安装.bootstrapTable() 后我无法点击v-on:click 但是没用过.bootstrapTable()用v-on:click是正常的

我需要收听任何附加功能吗? 或者我应该写什么样的代码?

file.vue

<template>
  <div>
    <table id="table">
        <tr>
          <th>#</th>
        </tr>
        <tr v-for="(d, index) in data" :key="index">
          <td><a class="btn btn-secondary" type="button" @click="callText(d.text)">{{d.text}}</a></td>
        </tr>
    </table>
  </div>
</template>

<script>
  export default {
    name: 'file',
    data () {
      return {
        data: [{"text":'1'},{"text":'2'},{"text":'3'}]
      }
    },
    methods: {
      buildTable() {
        $('#table').bootstrapTable('destroy').bootstrapTable({})
      },
      callText(t){
        console.log(t);
      }
    },
    mounted: function(){
       this.buildTable();
    }
  }
</script>

【问题讨论】:

    标签: vue.js vue-component


    【解决方案1】:

    你可以,而且它仍然有效。你甚至在看你的控制台吗?唯一的问题是光标没有像实际按钮那样变为指针。

    【讨论】:

      猜你喜欢
      • 2017-05-19
      • 2018-05-17
      • 2020-04-07
      • 1970-01-01
      • 2020-06-08
      • 2017-07-05
      • 1970-01-01
      • 2017-12-31
      • 2017-12-18
      相关资源
      最近更新 更多