Hi, I’m trying to use Vue refs with the new composition API.
However, it seems to only work when the ref="" is set directly into an ionic component.
For example I have the following (minimized) template:
<ion-content ref="content">
<div ref="canvas"></div>
</ion-content>
Then during setup():
const canvas = ref();
const content = ref();
onMounted(() => {
console.log(content.value);
console.log(canvas.value);
});
return {
canvas,
content
};
And the results show actual data from the ‘content’ element, but undefined for my ‘canvas’ div element:
Is there anything I’m missing? Any input greatly appreciated.