DEV Community

Cover image for Quick tip: Vue 2 Options API vs Vue 3 Composition Api
VueTraining.net
VueTraining.net

Posted on • Updated on

Quick tip: Vue 2 Options API vs Vue 3 Composition Api

Vue 2's Options API (left)
vs
Vue 3's Composition API (right)

They look pretty similar here, but Composition API really shines when things get complex.

Remember to use ".value" for the ref, and to return any variables or functions you'll be using in the template!

Alt Text

Discussion (0)