Template ref array gets children in onmounted, which is empty
Vue version
3.2.37
Link to minimal reproduction
Steps to reproduce
<script setup>
import { ref,onMounted } from 'vue'
onMounted(()=>{
console.log("got zero",itemsRef.length)
})
const itemsRef = []
const setItemsRef = (el)=>{
if(el){
itemsRef.push(el)
}
}
</script>
<template>
<div v-for="item in 10" :ref="setItemsRef">{{item}}</div>
</template>
What is expected?
The DOM structure in onMounted that operates on the ref array
What is actually happening?
The SFC Playground Cannot be reproduced.
This also occurs in the component's < slot > , where the child component can not manipulate the DOM in the slot from onMounted
System Info
No response
Any additional comments?
No response