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

[feature request] Allow boolean "false" in selectable component's true-value and false-value props to invert switch state for boolean value. #1633

Closed
Webifi opened this issue Sep 8, 2017 · 4 comments

Comments

@Webifi
Copy link
Contributor

Webifi commented Sep 8, 2017

In some cases, I run into boolean values that I want to display inverted from how they are stored. For example, a record may have a boolean "disabled" field, but I want the UI to show a switch as on when enabled (false).

It'd be nice if selectable components (Switches, Checkboxes, etc.) could have their true-value set to a Boolean of false. This should allow setting :true-value="false" and :false-value="true" to be used as a way of inverting the switch, so a false boolean value would show the switch on.

I should be able to take care of it by using :value="!myBoolean" and @input="myInvertMethod" instead of v-model, but since true-value and false-value are almost there...

@jacekkarczmarczyk
Copy link
Member

Duplicate of #1369

Related:
#1454
#1596 (PR #1598)

@johnleider
Copy link
Member

@jacekkarczmarczyk is correct, this is a duplicate. It will be done however, thank you!

@imShara
Copy link

imShara commented Jun 7, 2018

How to use this with v-model, when two-way data binding enabled?

@johnleider
Copy link
Member

If you have any additional questions, please direct them to the official Discord server.

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

4 participants