useTemplateRef with vue 3.5+ #17508
-
Hi there, We are updating to vue 3.5+ and try to use the new useTemplateRef feature. As you can see it has props and slots defined but can't access a method and therefore "casting" it to an any type but that doesn't feel right. Anyone else encountered this and know how to solve/deal with this? Thanks! Edit: When using the v-close-popup directive (as a workaround but even a better solution) I was able to trigger the close event now from the vue template. Question remains, is it possible to access the events on a quasar component when using useTemplateRef? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
do u tried to specify the type of the component? something like that: import type { QDate } from 'quasar'
const qDate = useTemplateRef<QDate>('qDateRef')
onMounted(() => {
if (qDate.value) {
qDate.value.setView('Years')
}
}) |
Beta Was this translation helpful? Give feedback.
do u tried to specify the type of the component?
something like that: