Reputation: 523
I have a problem with event listener for input radio.
HTML:
<input
type="radio"
id="flat"
name="property_type"
class="switch-input"
v-model="registerData.propertyType"
value="flat"
checked
/>
And when I add v-on="change:foo"
into input element, the page crash loading on that input radio.
Code:
var companyList = new Vue({
el: '#companyList',
cache: false,
data: {
disabledTime: {
to: new Date()
},
registerData: {
serviceCategoryId: '{{ $serviceCategoryId }}'
}
},
methods: {
foo: function() {
console.log('aaa');
}
},
})
What is the best way to call function on change event?
Upvotes: 8
Views: 48204