Skip to content

using a component containing a top level v-if in parent with $refs #6641

@TomKaltz

Description

@TomKaltz

Version

2.4.4

Reproduction link

https://jsfiddle.net/TomKaltz/aao0waem/

Steps to reproduce

Define a component where the top level element has a v-if. Declare that component in the parent template with a ref.

What is expected?

The ref should be available even if the component top-level v-if is false

What is actually happening?

Even if the v-if is false, the component is still accessible via $refs on first load. When you toggle the component v-if from false to true to false the parent ref becomes undefined. The component beforeDestroy and destroyed event also does not fire.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions