-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customize v-model in components #4515
Comments
I've also come across this when building ui components. We should come up with a way of defining the prop used for the v-model and eventually the event too. I was thinking about the same as @Akryum 🙂 |
Out of curiosity, is there value to overriding the model: 'currentValue', Also, this would probably require component authors to create a computed property for getting the model value, since it would technically be possible to extend the component with a different model name. computed: {
modelValue() {
return this[this.$model]
}
} |
@rpkilby We may want to redefine the event for radio/checkboxes inputs that emit <ui-checkbox @change="doStuff" v-model="visible">Visible</ui-checkbox> side note: little demo about differents inputs and events: http://jsfiddle.net/posva/oqe9e8pb/ |
Is there a way in VUE.JS to extend current binding directive to do some pre/post processing? Something like in KnockoutJS - see code below...
|
A way to change the
value
andinput
defaults would be great, especially for ui toolkits.My use case here is to create a Radio button component that would behave like a standard HTML one:
Here I'd like to change the prop used by
v-model
to something other thatvalue
, like for example acurrentValue
prop.Syntax proposal:
The text was updated successfully, but these errors were encountered: