DEV Community

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

Posted on β€’ Edited on

1

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

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay