Skip to content
Tutorials Center
My learning

Topics

Vue.js Tutorial

Learn Vue 3 from your first template to reactivity, the Composition API, components, forms, routing and state concepts, testing and real projects. 87 lessons with examples, quizzes and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 Introduction to Vue.js Meet Vue 3, the progressive JavaScript framework. Learn declarative rendering, how Vue compares to vanilla JavaScript and React, and where Vue is used.
  2. 2 Your First Vue App Build your first Vue 3 app with createApp and mount. Learn the root component, setup and data, template strings, in-DOM templates and how the live examples work.
  3. 3 Ways to Use Vue Compare the three ways to use Vue 3 (CDN script tag, import maps, and a Vite project from create-vue with single-file components) and pick the right one.
  4. 4 Static Assets, Fonts, Images and Env Variables in Vite Use images, fonts and environment variables in a Vue 3 Vite project: public versus src/assets, import URLs, @font-face, the @ alias, import.meta.env, .env files and image error handling.
  5. 5 Single-File Components Learn the anatomy of a Vue single-file component (template, script setup, scoped style), how a .vue file compiles, and a runnable equivalent in plain HTML.

Template Syntax

  1. 6 Text Interpolation Learn Vue text interpolation with double curly braces, JavaScript expressions in templates, the globals whitelist, v-text, v-once and why v-html can cause XSS.
  2. 7 Binding Attributes Learn Vue v-bind and the colon shorthand to set HTML attributes from data, including boolean attributes, dynamic names, object binding and same-name shorthand.
  3. 8 Class and Style Binding Bind CSS classes and inline styles in Vue 3 with object and array syntax, conditional classes, style objects, arrays of styles and automatic vendor prefixing.
  4. 9 Conditional Rendering Show and hide content in Vue 3 with v-if, v-else-if, v-else and v-show. Learn the template wrapper, how the two approaches differ and the cost of each.
  5. 10 List Rendering with v-for Render arrays, objects and number ranges with v-for in Vue 3. Learn why key matters, how to use template with v-for, and how to avoid the v-if with v-for trap.
  6. 11 Handling Events Listen to DOM events in Vue 3 with v-on and the @ shorthand. Compare inline and method handlers, use $event, event modifiers like prevent and stop, and key modifiers.

Reactivity Fundamentals

  1. 12 Reactive State with ref Learn how ref() creates reactive state in Vue 3, when you need .value and when you do not, how refs hold objects with deep reactivity, and why refs exist at all.
  2. 13 reactive Objects Learn Vue 3 reactive(): how proxy-based reactivity works, its limitations with destructuring and replacement, when to choose ref or reactive, and toRef/toRefs.
  3. 14 Computed Properties Learn how Vue computed properties work - caching versus methods, read-only getters, writable computed, why getters must stay free of side effects, and the previous-value argument.
  4. 15 Watchers Learn Vue watchers - watch sources, deep, immediate and once options, flush timing, watchEffect, stopping watchers and cleaning up side effects such as stale requests.
  5. 16 How Reactivity Works Look inside Vue 3 reactivity - proxies, track and trigger, the dependency graph, a working mini reactive system in plain JavaScript, plus shallowRef, triggerRef and markRaw.
  6. 17 DOM Update Timing and nextTick Understand why Vue updates the DOM asynchronously, how changes are batched into one render, when to use nextTick, and how watcher flush timing decides what the DOM looks like.
  7. 18 Reactivity Pitfalls Avoid the classic Vue 3 reactivity bugs - lost reactivity when destructuring, replacing reactive objects, mutating props, identity surprises, non-reactive values and debugging with onTrack.

Forms and User Input

  1. 19 Two-Way Binding with v-model Learn Vue v-model for text, textarea, checkbox, radio, select and multiple select, how it desugars to a value binding plus an event listener, and the lazy, number and trim modifiers.
  2. 20 Building Forms Build complete forms in Vue 3 - a reactive form object, @submit.prevent, reset that really resets, disabled states while sending, accessible labels and live status messages.
  3. 21 Form Validation Validate Vue 3 forms without a library - computed error messages, touched and dirty state, async username checks that ignore stale answers, and a reusable validator composable.

Components

  1. 22 Components Basics Learn Vue 3 components - how to define one, register it locally or globally, reuse it with independent state, follow naming rules, and use components in template-string and in-DOM apps.
  2. 23 Props Learn how Vue 3 components receive data with props - declaring types, defaults, required and validator options, boolean casting, one-way data flow and the mutating-props pitfall.
  3. 24 Events and emits Learn how Vue 3 components talk upward with custom events - emit with payloads, declare emits, validate them, listen with v-on on components, and follow naming conventions.
  4. 25 v-model on Components Build custom form inputs in Vue 3 - how v-model works on a component with modelValue and update:modelValue, defineModel, multiple v-models with arguments and custom modifiers.
  5. 26 Slots Pass markup into components with Vue slots. Learn default and named slots, fallback content, scoped slots, dynamic slot names and renderless components, with live examples.
  6. 27 Fallthrough Attributes Learn how Vue passes class, style, ids and event listeners from a parent to a component's root element, and how inheritAttrs false and $attrs give you full control.
  7. 28 Provide and Inject Share data with deeply nested Vue components without passing props through every level. Learn provide, inject, symbol keys, readonly state, default values and the trade-offs.
  8. 29 Dynamic and Async Components Switch components at runtime with component :is, keep their state with KeepAlive, and load heavy ones lazily with defineAsyncComponent, including loading and error states.
  9. 30 Template Refs and Exposing Methods Reach DOM elements and child components from code with Vue template refs. Learn when refs are available, refs inside v-for, function refs and how defineExpose limits the public API.
  10. 31 Designing Components Design Vue components that stay small and reusable. Learn single responsibility, container and presentational components, props versus slots, API design, naming and a reuse checklist.

Lifecycle and Composition API

  1. 32 Composition API and script setup Learn the Vue Composition API with setup() and script setup - what the template can see, how props and emits work, top-level await with Suspense, and how it compares to the Options API.
  2. 33 Lifecycle Hooks Learn the Vue 3 lifecycle hooks - onBeforeMount, onMounted, onUpdated, onUnmounted - the exact order they run in for parents and children, and how to clean up timers and listeners.
  3. 34 Composables Learn Vue composables - extract stateful logic into useX functions, pass refs in, return refs out, build useCounter and useMouse, and follow the conventions that keep composables predictable.
  4. 35 Composable Patterns Practical Vue composable patterns - a useFetch that handles races, useDebounce, a storage-backed ref, flexible inputs with toValue and MaybeRefOrGetter, and cleanup with onScopeDispose.
  5. 36 The Options API Learn the Vue Options API - data, methods, computed, watch and lifecycle options, how this works, the pitfalls of arrow functions, and how every option maps to the Composition API.
  6. 37 Transition Component Learn Vue's Transition component - the six CSS classes for enter and leave, named transitions, appear, out-in mode, duration and JavaScript hooks - with runnable animation examples.
  7. 38 TransitionGroup and List Animation Animate items entering, leaving and changing position in a v-for list with Vue's TransitionGroup, including move transitions, staggered delays and key rules.

Routing and Navigation

  1. 39 Routing Concepts Understand how single-page apps route without page reloads - route tables, dynamic params, hash versus history mode - and try a runnable route matcher.
  2. 40 Build a Tiny Hash Router Build a working hash-based router with plain Vue reactivity - route table, params, query strings, active links, redirects and a 404 page - in about 60 lines.
  3. 41 Vue Router Basics Learn the essentials of Vue Router - createRouter, routes, router-link, router-view, useRoute, useRouter, named routes and params - with a runnable stand-in.
  4. 42 Vue Router Advanced Features Go beyond the basics with Vue Router - nested routes, meta fields, navigation guards, lazy-loaded routes and scroll behavior, with runnable stand-ins for nesting and guards.

State Management

  1. 43 Sharing State Between Components Learn how to share state between Vue components - lifting state up, shared reactive modules and provide/inject - and when a store like Pinia is worth it.
  2. 44 Building a Simple Store Build a small Vue 3 store from reactive state, computed getters and action functions. Expose it read-only, share it across components and learn when a factory beats a singleton.
  3. 45 Pinia Learn Pinia, the official Vue store library. Define options and setup stores, use state, getters and actions, keep reactivity with storeToRefs and try a runnable plain-Vue stand-in.

Data Fetching

  1. 46 Fetching Data Fetch data in Vue 3 with onMounted and watch. Model loading, error and data state, refetch when an id changes, avoid race conditions with AbortController and test it against a mock API.
  2. 47 Real-Time Vue: WebSockets and Server-Sent Events Build real-time Vue 3 features: a useWebSocket composable with status, reconnect and cleanup, a useEventSource composable, and how to choose between WebSockets, SSE and polling.
  3. 48 Vue with Firebase, Supabase and GraphQL Connect Vue 3 to backend services: auth and database calls from a composable with Firebase and Supabase, real-time subscriptions with cleanup, and GraphQL queries with Apollo or urql.

Reusability, Transitions and Styling

  1. 49 Custom Directives Write your own Vue 3 directives. Learn the directive hooks, the binding object with value, arg and modifiers, and build v-focus and v-click-outside. Know when a composable is the better tool.
  2. 50 Plugins Learn how Vue 3 plugins work. Write an install function, add global components, directives, properties and provide/inject values, and build a small i18n and toast plugin you can run.
  3. 51 Render Functions and JSX Learn Vue 3 render functions with h(), vnodes, dynamic tags, slots and functional components. See how JSX fits in and when templates are still the better choice.
  4. 52 Teleport and KeepAlive Render modals outside their parent with Teleport, keep component state alive with KeepAlive, and get a quick tour of every built-in component Vue ships with.
  5. 53 Scoped CSS and CSS Modules Keep component styles from leaking with scoped CSS, reach into children with :deep and ::v-slotted, use CSS Modules, and drive styles from state with v-bind in CSS.
  6. 54 Styling Strategies Choose how to style a Vue app. Learn design tokens with CSS variables, utility CSS and Tailwind, class-based dark mode, and how component libraries compare.

TypeScript and Quality

  1. 55 TypeScript with Vue Use TypeScript in Vue 3 with script setup. Learn typed props and emits, typed refs and computed, generic components and how vue-tsc checks .vue files.
  2. 56 Code Quality and Style Keep a Vue codebase consistent with the official style guide priorities, ESLint with eslint-plugin-vue, Prettier, clear naming and a sensible file structure.
  3. 57 Accessibility in Vue Build accessible Vue apps with semantic HTML, focus management, ARIA bindings, route announcements, an accessible modal and an accessible form with errors.

Testing and Debugging

  1. 58 Testing Vue Apps Learn what to test in a Vue app, how the test pyramid applies, and how Vitest, Vue Test Utils and Testing Library fit together, with a runnable mini runner.
  2. 59 Unit Testing Components Mount Vue components in tests, check props, simulate clicks and typing, assert emitted events, handle async updates and use snapshots wisely, with a harness.
  3. 60 Testing Composables and Stores Test composables with and without a host component, mock fetch, keep stores isolated between tests and use the Pinia testing helpers, with runnable examples.
  4. 61 Debugging Vue Debug Vue apps: read dev warnings, use Vue DevTools, know dev versus production builds, catch errors with errorHandler and decode common messages.

Performance, Security and Ecosystem

  1. 62 Performance Basics Learn how Vue decides what to re-render, why stable props and computed values matter, and when v-once, v-memo and shallow reactivity help, with render counters.
  2. 63 Large Lists and Lazy Loading Render huge lists with virtual scrolling, store big data with shallowRef, lazy-load heavy components with defineAsyncComponent and load images only when needed.
  3. 64 Build and Load Performance Make a Vue app load fast. Learn what ends up in your bundle, how tree shaking and code splitting work, and how to lazy load routes and components with Vite.
  4. 65 Security in Vue Learn how Vue protects you from XSS, where it cannot, and how to handle v-html, user URLs, styles and templates safely, with a runnable sanitizer demo.
  5. 66 Authentication Patterns How login state works in a Vue app: cookies versus tokens, where to store them, route guards, handling 401 responses and refreshing sessions, with live demos.
  6. 67 Server-Side Rendering and Hydration Understand Vue server-side rendering: what renderToString produces, how hydration makes HTML interactive, why mismatches happen, and when SSR or SSG pays off.
  7. 68 Nuxt Overview Get to know Nuxt: file-based routing, auto imports, useFetch, server routes, rendering modes and deployment, with runnable stand-ins for its core ideas.
  8. 69 The Vue Ecosystem A guided map of the Vue ecosystem: Vite, Vue Router, Pinia, Vitest, VueUse, UI libraries like Vuetify and Quasar, Nuxt, Vapor mode and how to choose tools.
  9. 70 Internationalization with vue-i18n Translate a Vue 3 app with vue-i18n: messages, locale switching, interpolation, pluralization, number and date formats, lazy-loaded locales and right-to-left support, with a runnable model.
  10. 71 Component Libraries: Vuetify, PrimeVue, Element Plus Choose and use a Vue 3 UI library: compare Vuetify, PrimeVue, Element Plus and headless options, install them, theme with design tokens, keep bundles small with tree-shaking and check accessibility.
  11. 72 Migrating from Vue 2 and Vuex Migrate a Vue 2 app to Vue 3: breaking changes (filters, event bus, v-model, global API), the @vue/compat migration build, Options to Composition API and moving from Vuex to Pinia, step by step.

Projects

  1. 73 Project: Todo App Build a complete Vue 3 todo app in three live stages: list state with v-model, computed filters and counters, then components, inline editing and a useTodos composable.
  2. 74 Project: Weather Dashboard Build a Vue 3 weather dashboard against a mocked API: a status state machine, watch with stale-response protection, a useWeather composable and reusable cards with retry.
  3. 75 Project: Shopping Cart Build a Vue 3 shopping cart in three live stages: products and computed totals, a shared cart store used by several components, then coupons, free shipping and animated lines.
  4. 76 Project: Kanban Board Build a Kanban board in Vue 3: normalized card state, computed columns, a pure moveCard function you can test alone, then native HTML drag and drop with keyboard buttons.
  5. 77 Project: Notes App with Routing Build a multi-page Vue 3 notes app: a hash router written with plain reactivity, a shared notes store, list and detail views, a validated create and edit form, and a 404 page.
  6. 78 Project: Quiz App Build a quiz app in Vue 3 in two stages: the question flow with scoring and feedback, then a shared store, animated transitions between questions, keyboard answers and a results review.
  7. 79 Project: Expense Tracker with Charts Build an expense tracker in Vue 3: a validated form, money kept in cents, computed totals, a safe localStorage composable, category filters and a hand-made SVG bar chart component.
  8. 80 Project: Movie Search with Router and API Build a movie search app in Vue 3: debounced search with request cancellation, loading, empty and error states, a reusable useAsyncData composable, a hash router with a detail page and URL-synced query.
  9. 81 Project: Chat App Build a chat app in Vue 3: optimistic sending with sent and failed states, a retry button, auto-scrolling that respects the reader, then a WebSocket composable with acknowledgements and reconnect.
  10. 82 Project: Storefront with Pinia and Router Build a small online store in Vue 3: a catalog store with filters and sorting, a cart store with derived totals, then routes for product, cart and checkout pages with a guard and a validated order form.
  11. 83 Project: Reporting Dashboard with Composition API Build a reporting dashboard in Vue 3 with the Composition API: composables for data, filters and tables, KPI cards, a sortable paginated table, then SVG charts, provide/inject widgets and a CSV export.

Practice and Review

  1. 84 Practice Exercises with Solutions Twelve Vue 3 exercises on reactivity, components, forms and composables, each with a hint and a live, runnable solution. Try them yourself first, then compare.
  2. 85 Common Vue Mistakes and How to Fix Them Seven Vue 3 mistakes almost everyone makes - forgotten .value, lost reactivity, mutated props, bad keys, v-if with v-for and async races - each with a runnable fix.
  3. 86 Vue.js Interview Questions and Answers Twenty Vue 3 interview questions with clear answers and runnable examples - reactivity, ref vs reactive, computed vs watch, lifecycle, keys, Composition vs Options, Vue vs React.
  4. 87 Vue.js Cheat Sheet (Vue 3) A one-page Vue 3 quick reference - template directives, reactivity APIs, component APIs, lifecycle hooks, composable patterns and Options API equivalents, with runnable examples.