8000 Scoped states · Issue #12212 · vuejs/vue · GitHub
[go: up one dir, main page]

Skip to content
Scoped states #12212
Closed
Closed
@AbrahemAlhofe

Description

@AbrahemAlhofe

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0