无法从VueJS中侦听引导按钮组内的单击事件

Sen*_*kwe 3 javascript twitter-bootstrap vue.js

我在基于VueJS的项目中有以下引导按钮组...

<div class="btn-group btn-group-xs pull-right" data-toggle="buttons">
  <label class="btn btn-primary label-primary">
	<input type="radio" name="options" id="option1" autocomplete="off" v-on:click="clearEntries"> A
  </label>
  <label class="btn btn-primary label-primary">
	<input type="radio" name="options" id="option2" autocomplete="off" v-on:click="clearEntries"> B
  </label>
  <label class="btn btn-primary active label-primary">
	<input type="radio" name="options" id="option3" autocomplete="off" checked v-on:click="clearEntries"> C
  </label>
   <label class="btn btn-primary label-primary">
	<input type="radio" name="options" id="option4" autocomplete="off" v-on:click="clearEntries"> D
  </label>
</div>
Run Code Online (Sandbox Code Playgroud)

我想要做的就是在选择/选中其中一个单选按钮时调用方法.

但是click事件永远不会被触发.我不确定它是否被bootstrap css压制.

有任何想法吗?

Hap*_*wan 6

放在v-on:click="clearEntries"标签上而不是输入上.

new Vue({
  el: "#app",
  methods: {
    clearEntries: function() {
      alert('clearEntries !');
    }
  }
});
Run Code Online (Sandbox Code Playgroud)
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.2.5/vue.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<div id="app">
<div class="btn-group btn-group-xs pull-right" data-toggle="buttons">
  <label v-on:click="clearEntries" class="btn btn-primary label-primary">
	<input type="radio" name="options" id="option1" autocomplete="off"> A
  </label>
  <label v-on:click="clearEntries" class="btn btn-primary label-primary">
	<input type="radio" name="options" id="option2" autocomplete="off"> B
  </label>
  <label v-on:click="clearEntries" class="btn btn-primary active label-primary">
	<input type="radio" name="options" id="option3" autocomplete="off" checked> C
  </label>
   <label v-on:click="clearEntries" class="btn btn-primary label-primary">
	<input type="radio" name="options" id="option4" autocomplete="off"> D
  </label>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)