0๐
<div id="app">
<div data-toggle="buttons" class="btn-group">
taskTime {{ taskTime }}
<label class="btn btn-sm btn-white active">
<input type="radio" v-model="taskTime" value="7" name="taskTime"> Week
</label>
<label class="btn btn-sm btn-white">
<input type="radio" v-model="taskTime" value="30" name="taskTime"> Month
</label>
</div>
</div>
var vm = new Vue({
el: '#app',
data() {
return {
taskTime: null
}
},
watch: {
taskTime(newValue) {
console.log('clicked');
}
}
})
This is working snippet. You missed one โ}โ in your fiddle ๐
And one more thing: your build system can remove console.log from final code.
- [Vuejs]-Include html verification file in root Vue
- [Vuejs]-How to loop through a set of checkboxes and making each set independent of each other in vue.js
Source:stackexchange.com