I am facing a challenge with integrating a custom dropdown select component. The idea is to use v-model to retrieve data from the parent component, but I am unsure how to pass that through an emit. Can anyone clarify this for me?
Here is my parent component where I am calling the selector:
<DropdownSelect :items="items"/>
As you can see, I am passing an array of objects and the child component is iterating through them. How can I use v-model to get the selected data in the child component?
In the child component, I have an onClick function which contains the selected object:
emit('selected', get);
Is there an easy way to achieve something like this:
<DropdownSelect :items="items" v-model="something" />
without using emit? Perhaps I could do:
<DropdownSelect :items="items" @selected="object_here"/>
But I specifically need it to work with v-model. Is that possible?