Skip to content

Create a v-if-parent template directive #10078

Closed
@Tofandel

Description

@Tofandel

What problem does this feature solve?

I would like to have an optional component but with the content being always rendered (so v-if doesn't work with this use case)

It's currently not possible without a lot of code duplication

<my-component v-if="condition">
    <the-content>I'm visible</the-content>
</my-component>
<the-content v-else>I'm visible</the-content>

What does the proposed API look like?

What I would like to be able to write instead is this

<my-component v-if-parent="condition">
    <the-content>I'm visible</the-content>
</my-component>

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