DEV Community

loading...

Discussion on: Build a movie search app using the Vue Composition API

Collapse
muhaddimu profile image
Muhaddis

Thank you for writing and explaining things.
Now we're tracking the change with handleChange() function. As we use to do in React. What about v-model approach here? Can we use it with composition API? Correct me if I am wrong

Collapse
peterkassenaar profile image
Peter Kassenaar

I'm a bit late to the party - as I just started using the composition API myself - but it's definitely possible to use v-model, as before.

Just remember to set the variable you wish to assign to v-model in the setup() function, using a ref(). As in const newMovieName = ref(''); and use v-model="newMovieName".