-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Closed
Description
Version
2.3.4
Reproduction link
https://jsfiddle.net/floorish/7td2offb/
Steps to reproduce
- Parent with dynamic components, referenced by
ref:<component :is="child.type" v-for="child in children" :key="child.id" ref="children"></component> - Multiple
child.types where one of them uses a loading component:<loading v-if="isLoading"></loading> <div v-else>Child B ready</div> - In Child switch
isLoadingfromtruetofalseafter a timeout/async call
What is expected?
parent.$refs.children equals the displayed child components
What is actually happening?
parent.$refs.children only includes the child component that has the loading mechanism
This is very much an edge case, but it took me a while to figure out any solutions. Most trivial solution is to wrap the Child template in another <div>, but AFAIK the <div v-if="val"></div> <div v-else></div> construct in the root of a template is supported in Vue (there is always a single root element).
Other solutions are provided in reproduction link.
Metadata
Metadata
Assignees
Labels
No labels