Vue.js: Vue.js Introduction

Last updated: 2026-10-20

Vue.js is a progressive JavaScript framework for building user interfaces. It lets you develop web apps declaratively and component by component — from a simple form to a complex enterprise SPA.

This tutorial targets beginners with basic HTML/CSS/JavaScript. It starts from Vue 3's core concepts and takes you all the way to building a complete mid-sized e-commerce admin system on your own. The learning curve differs from W3Schools or Runoob — we go Vue 3 + Composition API first, practised against a realistic e-commerce project (a SaaS admin with 5,000 merchants and 30,000 SKUs).

Related Core:reactive()

1. What You'll Learn


2. A SaaS Team's Frontend Decision

(1) The pain: five frameworks, which one?

A fast-growing SaaS company has 200,000 lines of frontend code. In Q1 2026 its tech lead Alice faces a hard call:

Product manager Charlie piles on the pressure:

"Our admin manages 30,000 SKUs. Our current React app takes 8 seconds to filter. New developers need 3 weeks to ship their first feature. By Q3 2026 both numbers must improve 5×."

(2) The Vue 3 answer

After four weeks of evaluation, Alice picks Vue 3:

TEXT
Bundle size:     850KB → 280KB    (-67%)
Initial load:    3.2s  → 0.9s    (-72%)
Onboarding time: 3 weeks → 1 week (-67%)
Job market:      growing 35% YoY

Vue's "progressive" nature means Alice can adopt it step by step:

  1. Week 1: replace one page with Vue 3 (CDN script tag, no build step)
  2. Week 4: migrate 10 pages to single-file components
  3. Week 12: full SPA with Router and Pinia
  4. Week 24: all 200,000 lines migrated, zero downtime

(3) The payoff

Six months in, the team measures:


3. What Is Vue?

Vue (pronounced /vjuː/, like "view") is a progressive JavaScript framework for building user interfaces. Evan You created it in 2014; today the Vue core team and a global community maintain it.

(1) The definition + Vue 3 architecture

100%
graph TB
    subgraph Vue3Ecosystem
        V[Vue 3 Core<br/>@vue/runtime-core]
        R[Vue Router 4<br/>Routing]
        P[Pinia<br/>State Management]
        S[SSR/SSG<br/>Nuxt 3]
        T[Vite<br/>Build Tool]
        U[UI Libraries<br/>Element Plus/Naive UI]
    end
    
    V --> R
    V --> P
    V --> S
    T --> V
    U --> V
    
    style V fill:#42b883,color:#fff
    style R fill:#35495e,color:#fff
    style P fill:#ffd02f
    style S fill:#00dc82
    style T fill:#646cff,color:#fff

(2) Five core traits

Trait Meaning Comparison
Progressive framework Adopt as much as you need, from a lightweight library to a full framework React forces JSX; Angular brings the whole toolbox
Reactive data Data changes update the UI automatically, no manual DOM work jQuery needs $(sel).text() by hand
Componentisation Split the UI into reusable components (single-file components) HTML tags cannot be reused; components compose
Declarative rendering Describe what it should look like, not how to transform it Imperative DOM manipulation
Gentle learning curve HTML/CSS/JS basics are enough; TypeScript is incremental Angular requires decorators and DI first

(3) Where Vue fits

Scenario Fit Notes
Small to mid SPA (e-commerce/CRM/Admin) ⭐⭐⭐⭐⭐ Sweet spot, Vue's main use
Large enterprise apps ⭐⭐⭐⭐ Needs Nuxt 3 + micro-frontends
Mobile H5 ⭐⭐⭐⭐ uni-app / Vant
Desktop apps ⭐⭐⭐ Electron + Vue (workable)
Static blogs ⭐⭐ Astro / Nuxt Content fit better
Embedded widgets ⭐⭐⭐⭐⭐ Tiny footprint, CDN-only setup

▶ Example: CDN setup (a working page in 5 lines)

▶ Try it Yourself

Output: open the HTML file and the page shows "Hello Vue 3!" plus a button; each click increments the number.


4. Vue 3 vs Vue 2: Core Differences

(1) Improvements at a glance

Aspect Vue 2 Vue 3 Impact
Reactivity Object.defineProperty Proxy Faster, supports arrays/Map/Set
API style Options API first Composition API first More flexible logic reuse
TypeScript Manual setup First-class Better inference
Bundle size ~33KB ~20KB (gzipped) Faster loads
Render speed 1x 1.2-2x Faster
Tree-shaking Not supported Fully supported Unused code dropped
Fragment Single root Multiple roots More flexible templates
Teleport None Built in Simpler modals and drawers
Suspense None Built in Elegant async components

(2) Why Vue 3?

TEXT
✅ Vue 3 is the current major version (released 2020-09, stable for 5+ years in 2026)
✅ Vue 2 reached EOL in 2023-12 and is no longer maintained
✅ 90% of new projects and 100% of new tooling target Vue 3
✅ Composition API is the recommended modern style
✅ TypeScript support improved markedly, raising code quality

❌ Vue 2 matters only when maintaining legacy projects
❌ Skipping Vue 3 means missing 95% of modern Vue tooling

5. Composition API vs Options API

(1) Two API styles side by side

Aspect Options API Composition API
Structure data / methods / computed blocks One setup() function
Logic reuse mixins (not recommended) Composables (recommended)
Type inference Average Excellent (designed for TS)
Code organisation By option type By business logic
Learning curve Gentle (beginner friendly) Slightly steeper (ref/reactive)
Best scale Small to mid Mid to large (recommended everywhere)

(2) Options API example

JS
// Options API - grouped by option type (passed to createApp)
{
  data() {
    return { count: 0, name: 'Alice' }
  },
  computed: {
    doubleCount() {
      return this.count * 2
    }
  },
  methods: {
    increment() {
      this.count++
    }
  },
  mounted() {
    console.log('Component mounted')
  }
}

(3) Composition API example

JS
// Composition API - grouped by logic (inside setup())
const { ref, computed, onMounted } = Vue

setup() {
  const count = ref(0)
  const name = ref('Alice')

  const doubleCount = computed(() => count.value * 2)

  function increment() {
    count.value++
  }

  onMounted(() => {
    console.log('Component mounted')
  })

  return { count, name, doubleCount, increment }
}

Output:

TEXT
Hello Vue 3!
[Clicked 0 times] <- button
Each click adds 1: Clicked 1 times -> Clicked 2 times

(4) Which one?

Recommendation Scenario
New projects use Composition API The default for Vue 3 work
Maintaining legacy code Keep Options API (do not churn existing code)
Teams with many juniors Composition API can be easier (no this confusion)
Complex business logic Composition API (organise code by feature)

▶ Example: Options API version (for comparison)

▶ Try it Yourself

Output: the page shows "Hello Vue 3!" and "Count: 0, Double: 0"; clicking increments Count and Double follows automatically.


6. The Vue 3 Ecosystem

Vue 3 is not just a framework — it is a complete frontend ecosystem.

(1) Ecosystem map

100%
graph LR
    subgraph Core
        V[Vue 3 Core]
    end
    
    subgraph Official
        R[Vue Router 4]
        P[Pinia]
        T[Vite]
    end
    
    subgraph Community
        E[Element Plus]
        N[Naive UI]
        U[UnoCSS]
        I[Vue I18n]
    end
    
    V --> R
    V --> P
    V --> T
    V --> E
    V --> N
    V --> U
    V --> I
    
    style V fill:#42b883,color:#fff

(2) Key tools cheat sheet

Tool Role Must learn? Website
Vue 3 Core The framework itself ✅ Yes vuejs.org
Vite Build tool, 5x faster ✅ Yes vitejs.dev
Vue Router 4 Routing (essential for SPAs) ✅ Yes router.vuejs.org
Pinia State management (Vuex replacement) ✅ Yes pinia.vuejs.org
Element Plus Desktop UI library Optional element-plus.org
Naive UI Desktop UI library Optional naiveui.com
Vue I18n Internationalisation Optional vue-i18n.intlify.dev
Nuxt 3 SSR/SSG framework Optional nuxt.com
VueUse Composable utility library Optional vueuse.org

(3) The full learning path

TEXT
Phase 1 (this tutorial, Phases 1-3): Vue 3 core + Composition API
Phase 2 (this tutorial, Phase 4): Vue Router + Pinia + advanced APIs
Phase 3 (this tutorial, Phase 5): Vite + a real project + deployment
Advanced (recommended next): Nuxt 3 SSR / Vitest / performance tuning

Output:

TEXT
Hello Vue 3!
Count: 0, Double: 0
[+1] after click -> Count: 1, Double: 2 (doubleCount doubles automatically)

7. Putting It Together: Your First Vue 3 App

▶ Example: Hello Vue 3 counter (Composition API)

▶ Try it Yourself

Output (after clicking):

TEXT
Hello Vue 3! Welcome, Alice!

You clicked the button 5 times.

[Click me]

By Alice, 2026

Output:

TEXT
Hello Vue 3! Welcome, Alice!
You clicked the button 0 times.
[Click me] <- button
By Alice, 2026
After clicking: You clicked the button 1 times. (greeting and currentYear update via computed)

(1) 📊 4. Progress milestones (5 minutes / 30 minutes / 1 hour)

Milestone Time Done when
Hello World runs 5 min The Vue page renders in the browser
Change one line 10 min Edit the message value in the template
Add one reactive value 20 min Add a ref variable and display it
Add one interaction 30 min Add an @click handler and a counter
Deploy to Vercel 1 hour A public URL is reachable

(2) 📊 5. Five common pitfalls (5-minute save)

Pitfall Symptom Fix
Forgetting .value count++ does nothing In JS use count.value++ for refs
Template auto-unwrap .value is unnecessary there Just write {{ count }}
Lost object reactivity obj.name = 'x' does not update Wrap it with reactive()
Direct array assignment arr[0] = 'x' may not react Use splice or push
Async data Assigning inside setTimeout seems lost ref/reactive already handle it

Related Core:reactive()

❓ FAQ

Q Vue 3 or React — which should I pick?
A Pick the one you will actually finish learning. Both cover 95% of the work. Vue has a gentler curve and HTML-like templates, so beginners are productive in two weeks; React has a bigger ecosystem but its JSX mental model takes adjustment. The job market has plenty of demand for both.
Q Do I need TypeScript to use Vue 3?
A No. Vue 3 fully supports plain JavaScript. If you aim at enterprise projects, though, TypeScript is strongly recommended — Composition API plus TS is best practice, and type inference removes roughly half of the bugs.
Q Is the Composition API hard?
A A bit harder than the Options API (you need ref/reactive concepts), but far more powerful once it clicks. Start with the Options API for the basics, then move to Composition API for real work.
Q Can Vue 3 build mobile apps?
A H5 apps yes (uni-app). For native apps, Flutter or React Native are better. Vue 3 shines on the web (desktop and H5); mobile is secondary.
Q Will this tutorial get me a Vue job?
A Yes. It covers Vue 3 + Router + Pinia + Element Plus + Vite + TypeScript, which is what 90% of Vue job posts ask for. Project experience and algorithm practice come on the job.
Q Can Vue 2 projects still be maintained?
A They can be maintained but not upgraded — Vue 2 reached EOL in 2023-12 and new projects must use Vue 3. If you maintain legacy code, plan a migration.
Q Which well-known companies use Vue 3?
A GitLab, Nintendo, Adobe Behance, Alibaba (in parts), Xiaomi (in parts), BMW and NASA, among others. Vue keeps growing in China, Southeast Asia and Europe.

📖 Summary


📝 Exercises

  1. Basic (difficulty ⭐) Visit the vuejs.org docs, list three core Vue 3 features, and explain each in one sentence.

  2. Intermediate (difficulty ⭐⭐) Compare Vue 3 and React 18 across the following (use a table):

    Aspect Vue 3 React 18
    Bundle size ? ?
    Learning curve ? ?
    State management ? ?
    Routing library ? ?
    Market share in China ? ?
  3. Challenge (difficulty ⭐⭐⭐) Research three real projects around you (your company, a friend's company, an open-source project) and record:

    1. Which frontend framework does it use?
    2. Why was that framework chosen?
    3. What would a migration to Vue 3 cost?

    Write a 300-word report and post it in the comments.

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏