What Vue is and how it works
Vue is a JavaScript framework for user interfaces. You describe the interface with a template based on ordinary HTML, and the state with reactive data: when the data changes, Vue updates the affected parts of the page for you.
Vue suits both small additions to existing pages and large applications. You can add it to an existing HTML page without a build step, or embed it as web components on any page. With a build step (usually Vite), you write single-page applications (SPAs) in it, while server-side rendering (SSR) and static site generation (SSG) come from frameworks built on top of Vue, such as Nuxt. This is why the documentation calls Vue a progressive framework: you adopt it piece by piece as your needs grow.
The path from template to page runs through the compiler, a render function and the virtual DOM. The template is compiled into a render function, usually at build time, or in the browser if there is no build step. The render function returns a tree of virtual nodes (vnodes), the virtual DOM: a lightweight description of the interface in memory. Vue uses this tree to create the real DOM nodes. Rendering runs as a reactive effect: Vue tracks which data it read, and when that data changes it calls the render function again, compares the new tree with the old one and applies only the difference to the DOM.
The compiler knows the template ahead of time and leaves hints in the code: Vue creates the static parts of the page once and skips them when comparing during updates. This is why the documentation recommends templates, and render functions are rarely written by hand, mostly in library components with complex output logic.
Components are usually written as single-file components (SFCs), which are .vue files: logic goes in <script setup>, markup in <template> and styles in <style> (the scoped attribute limits styles to that component). Components have two API styles. In the Options API, you split logic across the data, methods and mounted options and access it through this. In the Composition API, you declare variables and functions directly in <script setup>. Both styles run on the same system; for applications with a build step, the documentation recommends the Composition API with SFCs, and this reference uses them.
How it differs from Vue Router, Pinia and Nuxt
| Project | What it does | When you need it |
|---|---|---|
| Vue | components, templates, reactivity | always: it is the core |
| Vue Router | official client-side routing: browser address → component, navigation without a page reload | in a SPA with several pages |
| Pinia | official store for shared state, maintained by the Vue team; replaced Vuex | when many components need the same data |
| Nuxt | framework for full-stack Vue applications: file-based routes, SSR by default, a server side | when pages should arrive from the server as ready-made HTML |
You add Vue Router and Pinia to a Vue application once it grows several pages or shared state. Choose Nuxt if a fast first screen and search indexing matter: it sends the browser ready-made HTML.
What you need to know first
- JavaScript: modules, functions, objects, promises — see the JavaScript reference.
- Markup and styles — see the “HTML and CSS” reference.
- Typing components — see the TypeScript reference; the examples here are in JavaScript.
The documentation advises against starting with a framework if you do not yet know HTML, CSS and JavaScript: learn the basics first, then Vue.
Section sources
the section is written from these pages- Introductionvuejs.org/guide/introduction.html(opens in a new tab)
- Rendering Mechanismvuejs.org/guide/extras/rendering-mechanism.html(opens in a new tab)
- Getting Started | Vue Routerrouter.vuejs.org/guide/(opens in a new tab)
- State Managementvuejs.org/guide/scaling-up/state-management.html(opens in a new tab)
- Introduction · Nuxtnuxt.com/docs/4.x/getting-started/introduction(opens in a new tab)