I'm attempting to call a function from one component to another, specifically from within the setup function. I came across a helpful article on VueMastery which suggests using the following approach:
methods: {
reset () {
this.$refs.counter.reset()
},
terminate () {
this.$refs.counter.terminate()
}
}
Unfortunately, I am unable to access these methods within the setup function, nor can I utilize this.$refs. Is there a way to achieve the same functionality within setup or access these methods?
Attempting to access these methods within setup results in them being undefined, and accessing setup data from within these functions or using $refs is also not possible.
While using $refs is a simple way to call functions from another component, I am struggling to find a straightforward method to accomplish this using Vue 3's composition API. Am I overlooking something?