【发布时间】: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