Skip to content

Assign :ref to zero result in missing element in $refs #7669

Closed
@Nattapong-sir

Description

Version

2.5.13

Reproduction link

https://jsfiddle.net/hhu05cd2/18/

Steps to reproduce

Assign any element with ref to 0.
Such as

What is expected?

p exist in $refs

What is actually happening?

p isn't in $refs


Workaround is to put additional char to :ref such as

Now, that p will be in this.$refs.

Reference: https://forum.vuejs.org/t/element-with-ref-0-disappear-from-refs/27925

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