Closed
Description
What problem does this feature solve?
v-model is a helpful tool, but it doesn't work in nested components. Instead we are supposed to use v-model on a parent component, then manually bind props and manually emit a change event within the child component. This is too verbose.
Instead, I am proposing an option for v-model that automatically emits the change event.
What does the proposed API look like?
Template for the parent component:
<div>
<custom-input v-model='foo'></custom-input>
</div>
Template for the child component:
<div>
<input type='text' v-model.sync='foo' />
</div>
AS AN ALTERNATIVE TO:
Template for the parent component:
<div>
<custom-input v-model='foo'></custom-input>
</div>
Template for the child component:
<div>
<input type='text' :value='foo' @input='$emit("input", $event.target.value)' />
</div>
Metadata
Metadata
Assignees
Labels
No labels