Hey guys!
I was wondering how to use component’s methods, for example ion-content scrollToTop(), in @ionic/vue. There seems to be no tutorials or docs about this. I’ve tried to use it on IonContent imported from @ionic/vue, but it seems to be not the case how to use those methods.
Any help will be appreciated. Sorry if I misplaced this topic, but I think this category is most relevant to the subject.
If I’m not mistaken, setup() runs after props are resolved, but before the component is mounted, so this line exposes those two items to the component when it mounts
Here’s the full code of the component.
I’ve tried:
const content = ref()
or
const content = ref(null)
On ref(null) I receive build error I’ve mentioned above.
On ref() (any) build succeeded.
But on button press I receive console error:
TypeError: content.value.scrollToTop is not a function. (In ‘content.value.scrollToTop()’, ‘content.value.scrollToTop’ is undefined)