Vue.js

Also known as: Vue

On this page 7

Vue.js, usually called Vue, is an open-source progressive JavaScript framework for building user interfaces and web applications from reusable components whose output updates automatically when their data changes. It was created by Evan You and first released in 2014, and it is maintained by an independent core team funded largely through community sponsorship rather than by a single large company.

The word progressive describes its central design idea: Vue can enhance a single widget on a server-rendered page, power a full single-page application, or run on the server through frameworks such as Nuxt. The current major version, Vue 3, was released in 2020 and introduced a rewritten reactivity system based on JavaScript proxies, the Composition API and first-class TypeScript support.

How Vue reactivity and rendering work

Vue combines a fine-grained reactivity system with a virtual DOM renderer. When a component reads reactive state during rendering, Vue records that dependency; when the state changes, only the components that depend on it are scheduled to re-render, and updates are batched into the next microtask.

Templates written in an HTML-based syntax are compiled into render functions ahead of time. The compiler marks static parts of the template and annotates dynamic nodes with patch flags, so the runtime can skip unchanged content during diffing. This compiler-informed virtual DOM is one reason Vue performs well without manual memoization.

PrimitivePurposeTypical use
ref()Wraps a single value as reactiveCounters, flags, primitive state
reactive()Makes an object deeply reactiveForm models and grouped state
computed()Cached value derived from other stateFiltered lists, totals
watch()Runs side effects when sources changeFetching data after a change
watchEffect()Tracks dependencies automaticallySimple synchronization effects
Core reactivity primitives in Vue 3

Components, single-file components and APIs

A Vue application is a tree of components. Most projects write them as single-file components with the .vue extension, which keep the template, script and scoped styles of one component together and are compiled by a build tool such as Vite.

Vue offers two styles for writing component logic. The Options API organizes code into options such as data, methods and computed, which many beginners find approachable. The Composition API, usually written with the script setup syntax, groups logic by feature and makes it easy to extract reusable functions called composables.

AspectOptions APIComposition API
Code organizationBy option typeBy logical feature
Logic reuseMixins, with naming conflictsComposables, explicit imports
TypeScript inferenceAdequateStrong
Learning curveGentler for beginnersSteeper but more flexible
Best fitSmall and medium componentsLarge components and libraries
Options API and Composition API

Components communicate through props passed down and events emitted up. For state shared across distant components, the officially recommended store is Pinia, which replaced Vuex as the default, while Vue Router provides client-side routing for single-page applications.

Vue.js compared with React, Angular and Svelte

Vue.js occupies a middle position among popular front-end frameworks: more batteries-included than React, lighter and less prescriptive than Angular, and closer to the classic HTML-first workflow than Svelte’s compile-away approach.

PropertyVue.jsReactAngularSvelte
TemplatingHTML-based templatesJSXHTML templatesHTML-based templates
Reactivity modelProxy-based trackingState setters and re-renderSignals and zone-based detectionCompiler-generated, runes
Official router and storeYesNo, community librariesYes, built inSvelteKit routing
Meta-frameworkNuxtNext.js and othersAngular SSRSvelteKit
GovernanceIndependent core teamMetaGoogleCommunity with Vercel support
Vue.js and neighboring frameworks

Framework choice rarely depends on raw speed, because all four are fast enough for typical interfaces. Team experience, ecosystem fit and hiring usually matter more. Vue is often chosen for its clear documentation and for its ability to be adopted gradually inside existing server-rendered applications.

Rendering modes and the Vue ecosystem

Vue supports several rendering strategies, and choosing the right one depends on SEO needs, content freshness and interactivity. Plain Vue renders in the browser, while Nuxt adds server-side rendering, static generation and hybrid per-route rules.

ModeToolingWhen it fits
Client-side renderingVue with ViteDashboards and logged-in tools
Server-side renderingNuxt or Vue SSR APIsPublic pages needing fast first paint
Static site generationNuxt or VitePressDocumentation and marketing sites
Progressive enhancementVue loaded on existing pagesAdding interactivity to legacy apps
Rendering options with Vue

With server rendering, the browser receives ready HTML and Vue then performs hydration, attaching reactivity and event listeners to the existing markup. Mismatches between server and client output produce hydration warnings and should be treated as bugs.

Limitations and common mistakes

Most Vue problems in practice stem from misunderstood reactivity rather than from the framework itself. Knowing the typical traps saves considerable debugging time.

  • Destructuring a reactive object breaks reactivity unless toRefs() is used.
  • Mutating props directly violates one-way data flow and triggers warnings; emit an event instead.
  • Missing or unstable keys in v-for lists cause incorrect element reuse and lost input state.
  • Overusing watchers where a computed property would suffice leads to redundant updates.
  • Mixing Vue 2 and Vue 3 guidance causes confusion, since Vue 2 reached end of life at the end of 2023.

Vue’s ecosystem of third-party libraries is smaller than React’s, which can matter for niche component needs. Large organizations sometimes also prefer frameworks with corporate backing, although Vue’s long track record and stable release policy reduce that concern.

In simple terms

Building a modern website is a bit like building with Lego bricks. Vue.js provides a way to make reusable bricks, such as a menu, a shopping cart or a search box, and to snap them together into a full application.

Its special talent is keeping the screen in sync with the data automatically. When a number in the cart changes, Vue notices and updates exactly the parts of the page that show it, so developers do not have to repaint the page by hand. It can also be added step by step, starting with one small part of an existing site.

A practical example

A regional insurance company runs a large server-rendered customer portal built a decade ago. Rewriting it at once is too risky, so the team introduces Vue.js one page at a time, starting with the claims form, which needs live validation, conditional fields and a document upload with progress bars.

The developers mount a Vue application on a single element of the existing page and write the form as single-file components with the Composition API, using a composable for validation that later serves three other forms. Within six months, five interactive pages run on Vue while the rest of the portal remains unchanged. Support tickets about failed claim submissions fall noticeably, and the team gains enough confidence to plan a gradual move to Nuxt for the public pages.