Skip to content

Conditional slots, is it possible? #2009

@kzima

Description

@kzima

How to achive this?
http://jsfiddle.net/kzima/5v8rLmp6/1/

My component's template looks like this:

<button v-show="!href"><slot></slot></button>
<a href="href" v-show="href"><slot></slot></a>

and it only works if I set the 'replace' param on the component to true, but then I end up with custom tag in my html.

Any thoughts?

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