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

Custom element v-model : rename type to v-model-type #1728

Closed
Benoit-Vasseur opened this issue Jul 28, 2020 · 1 comment
Closed

Custom element v-model : rename type to v-model-type #1728

Benoit-Vasseur opened this issue Jul 28, 2020 · 1 comment

Comments

@Benoit-Vasseur
Copy link

Benoit-Vasseur commented Jul 28, 2020

What problem does this feature solve?

v-model is now usable on web component :) see #1699 and this commit : 71c3c6e

However I have a suggestion concerning the type attribute on v-model on a custom element.
I think it could be safer to force the "type" and name the prop v-model-type instead of type. type looks to dangerous to me for naming collision. I was also thinking of but I do not think that it respects the design of the modifier, it is more an "adder" in this case.

What do you think : rename type to v-model-type and make it mandatory for custom element with a proper error message ? I can make a PR if you approve the idea :).

What does the proposed API look like?

  • <my-custom-elt v-model="model" v-model-type="text" />
@yyx990803
Copy link
Member

I don't really think this is necessary. If you have a custom input element that is expected to work with v-model and have something like type="radio" or type="checkbox" on it, it would be really weird for it to not indicate that "this element behaves like a native radio/checkbox".

Adding yet another built-in directive for this highly unlikely case seems overly cautious to me.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants