Vue

An approachable JavaScript framework for building web interfaces.

Vue is a framework for building user interfaces, designed to be easy to pick up. You can add it to a page with a single script tag or use it to build a full single-page app.

  • Intermediate
  • 7 lessons
  • Runs in your browser
Not started yet
Start lesson 1

Lessons

  1. Hello, Vue!You will write your first Single File Component, a .vue file that keeps a component's template, script and styles together. Every Vue app is built from these.
  2. Reactivity: ref & reactiveYou will learn how Vue tracks data with `ref` and `reactive` and updates the page when it changes. Knowing when to use each avoids the most common Vue mistakes.
  3. Template DirectivesYou will learn the directives (`v-if`, `v-for`, `v-bind`, `v-on`, `v-model`) that connect your data to the page. They are special attributes that start with `v-`.
  4. Components & PropsYou will learn how components pass data down with props and send messages up with emits. This one-way flow makes it clear where data comes from.
  5. ComposablesYou will learn how to write composables: plain functions that use the Composition API to share reactive logic between components. They are Vue's equivalent of React's custom hooks.
  6. Mini Project: Todo App with PiniaYou will build a todo app with Vue 3 and Pinia, Vue's official state management library. It brings together components, reactivity and shared state.
  7. Vue CheatsheetComposition API, template syntax, and reactivity on one page.

Install it on your own computer

Install Node.js, then create a Vue project with Vite, which is the official setup. You can also add Vue to an existing page from a CDN. You do not need this to follow the lessons: the examples run in your browser.

Bash
# Create a Vite-powered Vue app:
npm create vite@latest my-app -- --template vue
cd my-app
npm install
npm run dev

# With TypeScript:
npm create vite@latest my-app -- --template vue-ts

What people build with Vue

Learn the basics first, then pick up these tools when a project needs them.

Practical uses

  • Add interactivity progressively to existing pages
  • Build single-page applications
  • Create server-rendered sites with Nuxt
  • Develop dashboards and content tools

Projects to try

  1. Reading list
  2. Markdown knowledge base
  3. Inventory dashboard
  4. Nuxt storefront

Common tools and packages

NuxtPiniaVue RouterVueUseVitestVue Test UtilsVuetifyVite

Well-known software

GitLabLaravel ForgeStatamicPageKitVue StorefrontFont Awesome site