Skip to content

Clarify v-model in the docs #1965

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

Closed
yamsellem opened this issue Jan 29, 2019 · 2 comments
Closed

Clarify v-model in the docs #1965

yamsellem opened this issue Jan 29, 2019 · 2 comments
Labels

Comments

@yamsellem
Copy link

What problem does this feature solve?

On multiple occasions, the docs clearly stated that v-model on a component uses value as the prop and input as the event (here and there).

On standards inputs, the documentation (here) don't explain what can be expected from v-model, and how to replace its default behavior (when writting wrappers, for example). I have found that:

  • on input[type=text] and textarea, v-model uses value as the prop and input as the event
  • on input[type=radio] and input[type=checkbox], v-model uses checked as the prop and input as the event — but seems to collide with value (#8379)
  • on select, v-model uses value as the prop and change as the event

Some issues are related to this:

  • dynamic input value with radio buttons don't work in IE11 #8379 — related to this section of the docs which breaks the default IE9+ compatibility
  • <select @input="..."> doesn't work in IE11 but works with v-model #4701

May you please consider detailing for each control (input, radio, checkbox, select, textarea) what is the expected behaviour of v-model? This would be of great help!

What does the proposed API look like?

--

Related to #9370

@phanan
Copy link
Member

phanan commented Jan 29, 2019

@yamsellem Thanks for reporting the issue. I see that it's almost an exact copy from vuejs/vue#9370, which has been explained/clarified by @yyx990803. Do you think his clarification doesn't answer your question?

@yamsellem
Copy link
Author

@phanan I think @yanxyz clarification is:

  • the issue is not related to vue but to its docs: I copied it here
  • the issue is not related to component but to standard inputs: I've tried to clarify the point here

In a nutshell: the expected behavior of v-model is not documented for standard inputs, and it would be of great help if it was.

(so no, @yyx990803 don't answer my question, sorry)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants