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

Hide directive #1133

Closed
wants to merge 1 commit into from
Closed

Hide directive #1133

wants to merge 1 commit into from

Conversation

pespantelis
Copy link

It is the opposite of show directive.

@azamat-sharapov
Copy link

Doesn't this make API more verbose and add more size to library? Why not just v-show="!show"?

@pespantelis
Copy link
Author

IMO v-hide="show" is more clean and readable from v-show="!show".
Regarding the library, it is increased less than half of KB.

@yyx990803
Copy link
Member

Thanks for the PR, but let me explain why I don't want to add v-hide: the general philosophy behind Vue is we want to keep it as lightweight as possible, so when we add code into the codebase, we want to make sure the code either provides substantial improvement to an existing feature, or adds a new functionality that cannot be trivially achieved with the current API. In general, we want to avoid adding code just for the sake of stylistic alternatives. In fact we have been trying to removing stylistic alternatives as much as possible (e.g. v-with vs props).

v-hide, in my opinion, is just a stylistic alternative to v-show, and its benefit over v-show is somehow subjective and marginal.

Regardless, I appreciate your effort and hope to see you contributing to Vue again in the future :)

@yyx990803 yyx990803 closed this Aug 9, 2015
@pespantelis
Copy link
Author

Thank you for the detailed explanation :)

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

Successfully merging this pull request may close these issues.

None yet

3 participants