Skip to content

Trigger a warning when v-show and other incompatible directives are used on <template> #10786

Open
@mrleblanc101

Description

@mrleblanc101

What problem does this feature solve?

Hi,

I lost quite some time trying to figure out when my code didn't work.
The error was on my part, not vue, but i think Vue should trigger an error in this case.

The problem is that you CANNOT use v-show on a <template> tag, which make sense since v-show add inline style to the node and the <template> tag does not render a node.

What does the proposed API look like?

A Vue warning/error should suggest changing the v-if (if possible) or change the <template> tag for a DOM element (like a <div>)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions