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

Linear progress should not use v-model #813

Closed
ishitatsuyuki opened this issue Jun 22, 2017 · 10 comments
Closed

Linear progress should not use v-model #813

ishitatsuyuki opened this issue Jun 22, 2017 · 10 comments

Comments

@ishitatsuyuki
Copy link
Contributor

v-model should be used for two-way bindings. I don't see any way a progress bar can receive input from user. A simple property (probably named "value") should be used instead.

(semver breaking change)

@johnleider
Copy link
Member

Well you described exactly how vmodel works. You CAN use :value.

@ishitatsuyuki
Copy link
Contributor Author

How about closing this issue with a PR updating docs? You confirmed how vmodel works, so it's completely backward compatible.

@johnleider
Copy link
Member

johnleider commented Jun 22, 2017

Updating docs how? Do you understand how v-model works?

@ishitatsuyuki
Copy link
Contributor Author

ishitatsuyuki commented Jun 22, 2017

The API reference mentions v-model. It should be replaced with value.

@johnleider
Copy link
Member

Why though? It doesn't matter. The only difference is v-model creates an @input binding for you. There is no "should", this is just your preference.

@ishitatsuyuki
Copy link
Contributor Author

It completely looks like some misuse, since this is essentially one way binding. It confused me because I once suspected that the progress bar actually generates input.

@johnleider
Copy link
Member

I understand your POV, but it's not something I agree with. You are free to make a PR to the dev docs though.

@cawa-93
Copy link
Contributor

cawa-93 commented Jun 22, 2017

@ishitatsuyuki Partially I agree with you. The component does not emit an event input. And the use of v-model expects this, though not necessarily.
Using v-model creates a bi-directional binding. Thus, this can be a bit confusing, because if you do not look at the source code of the component, it is not clear in which case the component can change your data.

On the other hand, the use of v-model is more universal.

  1. This will preserve backwards compatibility, if in the future the component will emit the input event.
  2. The v-model is used for all other components. Let it be standardized.

@johnleider
Copy link
Member

What @cawa-93 mentioned is part of the discussion on the dev team. The point is to have a similar API/Interface to deal with components so that you know what to expect. Being as you understand what v-model is actually doing, then you could just do :value and everything will be fine. I think for the sake of keeping things the same across components, I want to leave it as such.

With that being said, I agree that it is important to inform the developer of this information. I will make an update to the docs that outlines this information for all v-model implementing components.

@lock
Copy link

lock bot commented Apr 16, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please direct any non-bug questions to our Discord

@lock lock bot locked as resolved and limited conversation to collaborators Apr 16, 2019
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

3 participants