Skip to content

Vue Knowledge Base ​

This set of docs is a systematic walkthrough of Vue 3: from template syntax to reactivity internals, from component design to routing and state management, ending with performance and common pitfalls. It's not a copy of the official API list — it's organized around "the problems you actually hit in real development", with comparisons, traps, and selection advice on every page. Aimed at developers with JS basics who are learning Vue or filling knowledge gaps.

Vue's core mindset: frame it first, then the details ​

Grasp these main threads and most of Vue 3's design becomes a corollary:

ThreadMeaningConsequence
Template is a DSLDirectives in <template> (v-if/v-for/v-model) are compiled into a render functionStatic content is hoisted and cached, dependencies collected precisely — lots of "magic", little boilerplate
Reactivity systemref/reactive built on Proxy track dependencies automaticallyChange data → the view updates itself, no manual notification
Precise updatesCompiler + runtime together mark "which node depends on which data"Only affected parts re-render by default; you rarely optimize manually
Two-way sugarv-model is really a modelValue prop + an update:modelValue eventForms are extremely fast to build, but see through it: underneath it's still one-way flow
Progressive frameworkRouter, state, build tool are official-but-separate librariesFrom a single <script> tag to a full stack — adopt as needed

In one line: Vue makes 80% of the decisions for you (dependency tracking, update granularity, template compilation), you handle the business; the cost is understanding where the "magic" ends — the writings that break dependency tracking are exactly the high-frequency pitfalls.

Sub-page navigation ​

#TopicWhat you'll learn
1Template SyntaxInterpolation and the full v-bind/v-on family, class/style binding, conditional & list rendering, what key means, event modifiers
2Computed & Watchcomputed caching and getter/setter, the three watch forms, watchEffect, deep/immediate/flush, how to choose
3Component SystemThe full props/emits chain, defineModel, three slot forms, dynamic components, KeepAlive, Teleport, async components
4Reactivity & LifecycleProxy internals, ref vs reactive, deactivation traps, the lifecycle map, nextTick, composables
5Forms & Communicationv-model internals and every modifier, native control binding, validation approaches, a full communication decision map
6Routing (vue-router)The whole route-config syntax, nesting & dynamic matching, guard execution order, meta auth, scroll & lazy loading
7State Management (Pinia)state/getters/actions, option vs setup stores, storeToRefs, persistence, modularization, Pinia vs component state
8Performance & Best PracticesCompile-time optimization (static hoisting / patch flags), shallowRef/v-memo, virtual lists, bundle optimization, 12 common pitfalls

Suggested path: 1 → 2 → 3 → 4 are the foundation (especially page 4's reactivity internals — it explains every "why" from the earlier pages); 5–7 are hands-on walkthroughs of the three official companion libraries; come back to 8 when you hit performance issues or weird behavior.

Quick reference: main Vue 2 → Vue 3 changes ​

Saves a lot of doc-digging when maintaining or migrating a Vue 2 project:

AspectVue 2Vue 3
Component styleOptions API (data/methods/computed blocks)Composition API + <script setup> (Options still supported)
ReactivityObject.defineProperty, needs Vue.set for new propsProxy, add/delete properties both detected
Logic reusemixins (name clashes, unclear origin)composables (explicit import/export)
Local statedata() { return {...} }ref() / reactive()
Watchingwatch optionwatch / watchEffect functions
Event busnew Vue() + $on/$emitremoved — use mitt or lift state
Global stateVuex (mutations + actions)Pinia (only state/getters/actions)
Routingvue-router 3vue-router 4 (createRouter + split history modes)
Functional componentsneeded a special flagstateless function components removed — just use templates
.sync modifier:prop.syncv-model:prop
$listenersseparatemerged into $attrs
Filters | pipebuilt-in template filterremoved — use computed or methods
Root nodesingle-root limitmultiple roots (Fragment), attributes forwarded explicitly
Teleportnone (manual appendTo)built-in <Teleport to="body">
Build toolwebpack + vue-cliVite + @vitejs/plugin-vue (de facto standard)
TypingTS support was awkwardTS-native friendly, defineProps<T>() generic inference

Learning resources ​