Vue: Assign :ref to zero result in missing element in $refs

Created on 20 Feb 2018  ·  1Comment  ·  Source: vuejs/vue

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

bug

Most helpful comment

Looks like a bug. Probably this check should be replaced with if (!isDef(key)) return

>All comments

Looks like a bug. Probably this check should be replaced with if (!isDef(key)) return

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hiendv picture hiendv  ·  3Comments

guan6 picture guan6  ·  3Comments

robertleeplummerjr picture robertleeplummerjr  ·  3Comments

seemsindie picture seemsindie  ·  3Comments

paulpflug picture paulpflug  ·  3Comments