Skip to content
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

.bubble modifier for v-model #11611

Closed
martixy opened this issue Aug 25, 2020 · 1 comment
Closed

.bubble modifier for v-model #11611

martixy opened this issue Aug 25, 2020 · 1 comment

Comments

@martixy
Copy link

martixy commented Aug 25, 2020

What problem does this feature solve?

Mostly just a convenience.
It would allow the last example here: https://vuejs.org/v2/guide/components.html#Using-v-model-on-Components
...to work without losing the syntactic sugar of v-model.

Makes it usable with props as well, which is one way v-model can trip you up sometimes (getting prop mutation warnings if v-modeling a prop).

What does the proposed API look like?

v-model.bubble="value"

This would result in

v-bind:value="value"
v-on:input="$emit('input', $event)"
@posva
Copy link
Member

posva commented Aug 25, 2020

This is not possible without major refactoring in v2 because the template on the parent cannot change the render function on the children and it involves knowing the type of the child.

Some relevant conversations: #6216 vuejs/core#9

@posva posva closed this as completed Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants