Skip to content

Clarify v-model in the docs #9370

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 25, 2019 · 1 comment
Closed

Clarify v-model in the docs #9370

yamsellem opened this issue Jan 25, 2019 · 1 comment

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) but this is not true.

  • 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
  • on select, v-model uses value as the prop and change as the event

More relevant issues related to this:

  • dynamic input value with radio buttons don't work in IE11 #8379
  • <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, etc) what is the role of v-model? This would be of great help!

What does the proposed API look like?

--

@yyx990803
Copy link
Member

yyx990803 commented Jan 25, 2019

  1. This is not a feature request to Vue core, it should be submitted to the docs repo: https://github.com/vuejs/vuejs.org

  2. The doc stated that "v-model on a component uses value as the prop and input as the event". <input> is not a component, it is a native element. This means the two sections you linked to explicitly do not apply to <input>. Relevant usage of v-model on native elements is properly covered here.

  3. The issues you linked to seems to be irrelevant to how v-model is documented.

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