-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Description
Hi,
I am using vuejs 2.0.1 and I want to create a component that looks like this:
<vue-checkbox v-model="page.ads_able"></vue-checkbox>
As from the api page that v-model is a syntactic sugar combinding :value
and @input
.
So I write a template with a props name value and a method for input event like this:
...
<input type="checkbox" :value="value" @input="onInput" />
...
...
props: {
value: {},
},
methods: {
onInput(event) {
this.$emit('input', event.target.value)
}
}
...
But it doesn't work. I don't know if there any special care about checked attribute of the checkbox. I tried the exact same thing with <select>
and it's worked as aspect though. Any suggestion?
Metadata
Metadata
Assignees
Labels
No labels