Skip to content

Console warning when using a v-if on an element inside a v-for on a template #1734

@IonianPlayboy

Description

@IonianPlayboy

Version

3.0.0-rc.5

Reproduction link

https://jsfiddle.net/Nate_L/0y3kbmaf/13/

Steps to reproduce

  1. Run the code
  2. Open the console

What is expected?

The code works without any warning in the console

What is actually happening?

The code works, but a warning is logged in the console ([Vue warn]: Template compilation error: v-if branches must use compiler generated keys.)


Changing Vue to version vue@3.0.0-rc.4 fixes the bug.

Note that the warning happens no matter what is put inside the v-if, I tried with other reactive properties or to set it to true.
I have other v-if inside my codebase which are not inside a <template> with v-for, and all of them works without issuing a warning.

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