Roadmap › 4. Frontend › Step 51
Vue

Vue.js 3 (with Pinia, Vue Router & Nuxt basics)

Vue instance and SFCs, template syntax and directives, reactivity (ref, reactive, computed, watch), Options vs Composition API, components, props, emits, slots, provide/inject, lifecycle hooks, composables, Vue Router, Pinia, forms, performance, testing and Nuxt.
What it is & where it is used

Vue.js is a progressive JavaScript framework for building user interfaces, created by Evan You (ex-Google, worked on AngularJS) in 2014. "Progressive" means you can use it as a drop-in script to enhance a page, or as a full SPA framework with router, state management and SSR.

Key characteristics:

  • Single-File Components (SFCs) — .vue files with <template>, <script> and <style> together.
  • Declarative templates with directives (v-if, v-for, v-model, v-bind, v-on).
  • Fine-grained reactivity — Vue tracks which components depend on which state (via JavaScript Proxies in Vue 3) and re-renders only what's needed.
  • Two API styles: Options API (data, methods, computed) and Composition API (ref, reactive, computed inside <script setup>).
  • Official ecosystem: Vue Router, Pinia (state), Vite (build tool, also created by Evan You), Vue DevTools, Nuxt (full-stack framework, third-party but closely aligned).

Vue sits between AngularJS-style templates and React-style components: approachable for beginners, scalable for large apps (used by Alibaba, Xiaomi, GitLab, Nintendo and many Asian companies).

Versions & history
VersionDateHighlights
0.xFeb 2014First public release
1.0Oct 2015"Evangelion"
2.0Sep 2016Virtual DOM, server-side rendering, render functions
2.5 / 2.62017 / 2019Better TypeScript; 2.6 v-slot syntax
2.7Jul 2022"Naruto" — backports Composition API and <script setup> to Vue 2
—31 Dec 2023Vue 2 end of life (commercial extended support available, e.g. HeroDevs)
3.0Sep 2020"One Piece": Composition API, Proxy-based reactivity, Fragments, Teleport, Suspense, better TypeScript, smaller and faster
3.2Aug 2021<script setup> stable, v-memo, defineCustomElement
3.3May 2023Generic components, imported types in defineProps, defineOptions, defineSlots
3.4Dec 2023Rewritten template parser (2× faster), defineModel stable, v-bind same-name shorthand
3.5Sep 2024Reactivity memory/performance overhaul, reactive props destructure, useTemplateRef, useId, lazy hydration, onWatcherCleanup
3.6 (in development)2025–Vapor Mode (compile without virtual DOM, opt-in, alpha), alien-signals based reactivity

Ecosystem: Vuex (official store for Vue 2) → Pinia became the official recommendation (2022). Vue CLI (webpack) → create-vue + Vite. Nuxt 3 (2022), Nuxt 4 (July 2025).

Lifecycle

Component lifecycle (Composition API hook → Options API name):

PhaseComposition APIOptions APIUse
Setupsetup() / <script setup> runsbeforeCreate, createdInitialise state; no DOM yet
Before mountonBeforeMountbeforeMountTemplate compiled, about to render
MountedonMountedmountedDOM available — fetch data, third-party libs, focus
Before updateonBeforeUpdatebeforeUpdateState changed, before DOM patch
UpdatedonUpdatedupdatedDOM patched (avoid changing state here)
Before unmountonBeforeUnmountbeforeUnmount (Vue 2: beforeDestroy)Cleanup start
UnmountedonUnmountedunmounted (Vue 2: destroyed)Remove listeners, timers
ErrorsonErrorCapturederrorCapturedError from a descendant
KeepAliveonActivated / onDeactivatedactivated / deactivatedCached components shown/hidden
SSRonServerPrefetchserverPrefetchFetch data during SSR

Reactivity update cycle: state change → the reactive Proxy's set trap triggers the effects (components, computeds, watchers) that read that property → component re-render is queued and batched in the next microtask (nextTick) → virtual DOM diff (optimised by compiler hints: static hoisting, patch flags, block tree) → DOM patched → onUpdated.

App bootstrap: createApp(App) → app.use(router), app.use(createPinia()), global components/directives → app.mount("#app").

Tools used to develop
ToolUse
npm create vue@latest (create-vue)Scaffold a Vite-based project (TS, Router, Pinia, Vitest, ESLint options)
ViteDev server and build
Vue DevTools (browser extension + Vite plugin)Inspect components, Pinia, router, timeline
VS Code + Vue - Official extension (Volar)SFC IntelliSense and type checking (vue-tsc)
Vue Router, PiniaRouting and state
VueUseCollection of composables
Vuetify, PrimeVue, Element Plus, Naive UI, QuasarUI libraries
VeeValidate, FormKit, Zod/YupForms and validation
Vitest + Vue Test Utils, Playwright/CypressTesting
NuxtSSR/SSG/full-stack framework
Vite-SSG, Pinia Colada / TanStack Query for VueStatic generation and data fetching