Skip to content

Scoped states #12212

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
AbrahemAlhofe opened this issue Aug 10, 2021 · 3 comments
Closed

Scoped states #12212

AbrahemAlhofe opened this issue Aug 10, 2021 · 3 comments

Comments

@AbrahemAlhofe
Copy link

What problem does this feature solve?

when we want to do something like hide / show password input we should add state called "IsVisible" in our data but actually this data is specific for this input not relate to our app so we shoud put it on a scope of the element to prevent our data's pollution

What does the proposed API look like?

<div class="field" v-data="{ isVisible : false }">
   <button @click="isVisible = !isVisible">isVisible ? 'hide' : 'show'</button>
   <input :type=" isVisible ? 'text' : 'password' " />
</div>
@posva
Copy link
Member

posva commented Aug 10, 2021

Please search v-scope in issues and PR to see this was already asked

@vuejs vuejs locked and limited conversation to collaborators Aug 10, 2021
@vuejs vuejs unlocked this conversation Aug 10, 2021
@posva posva closed this as completed Aug 10, 2021
@nfplee
Copy link

nfplee commented Nov 13, 2021

@posva where can I find the existing pr/issue? I’ve tried searching it in both but cannot find it. This is actually how I stumbled upon this issue as this is the one thing I can do in petite vue that I can’t do in vue without having to create a component.

@nfplee nfplee mentioned this issue Dec 1, 2021
@posva
Copy link
Member

posva commented Dec 1, 2021

Duplicate of #7325

@posva posva marked this as a duplicate of #7325 Dec 1, 2021
@vuejs vuejs locked as resolved and limited conversation to collaborators Dec 1, 2021
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