← All open source projects

Vue 2

vuejs/vue

Vue 2 is the previous major line of Vue.js: a progressive JavaScript framework for building web interfaces with templates, reactivity, and single-file components.

Forks 33,862
Author vuejs
Language TypeScript
License MIT
Synced 2026-06-07

What Vue 2 is

Vue 2 is the previous major line of Vue.js, a progressive JavaScript framework for web interfaces. The vuejs/vue repository tracks Vue 2 specifically; current Vue 3 development lives in vuejs/core. This page should therefore be read as a look at a mature and historically popular Vue 2 repository, while new projects should check Vue 3 separately.

Vue appeared as a gentler way to build interactive UI: start with one widget on a server-rendered page, then grow into a full application with components, routing, state management, and build tooling. Vue 2 became an entry point for many teams because it did not require rewriting the whole frontend at once and stayed close to ordinary HTML thinking.

At the model level, Vue 2 combines template syntax, reactive data, and components. The developer describes component data and how it appears; Vue connects state changes to the DOM without manual query selectors and imperative updates.

A Vue single-file component

An SFC keeps template, behavior, and styles next to each other. It is not required for every case, but it is convenient for medium-sized component UI.

Language: Vue
<template>
  <button @click="count++">
    Clicked {{ count }} times
  </button>
</template>

<script>
export default {
  data() {
    return { count: 0 };
  }
};
</script>

<style scoped>
button { padding: 0.5rem 0.75rem; }
</style>

Why Vue 2 became popular

The main reason is low entry cost without feeling toy-like. Templates resemble HTML, directives such as v-if and v-for are readable, computed properties keep derived state understandable, and components give applications room to grow.

Vue 2 also arrived at a moment when many teams wanted to move away from jQuery-style code but were not ready for a hard jump into a completely new frontend stack. Vue could enhance part of a page, then add a build step, then move into single-file components and routing when the product needed it.

Reactive data and computed values

Computed properties are useful when a value is derived from state and should update automatically.

Language: Vue
<template>
  <p>{{ fullName }}</p>
</template>

<script>
export default {
  data() {
    return { first: "Ada", last: "Lovelace" };
  },
  computed: {
    fullName() {
      return `${this.first} ${this.last}`;
    }
  }
};
</script>

Strengths

Vue 2 is strong in interfaces where readability, gradual adoption, and component structure matter more than ceremony. It fits admin panels, form-heavy products, content sites with interactive blocks, and teams that want a clear connection between template and state.

The ecosystem mattered too: Vue Router, Vuex, CLI/tooling, Nuxt, and documentation helped teams build full applications, not just widgets, while the base model stayed approachable.

Limits and Vue 3 context

The main limitation today is lifecycle. Vue 2 reached end of life on December 31, 2023, so new projects should usually start with Vue 3 and vuejs/core. Vue 2 still appears in older products, articles, Stack Overflow answers, and packages, but it is legacy context now.

Vue also does not replace architecture decisions. It gives a good component model and reactivity, but teams still decide routing, data loading, state boundaries, server rendering, forms, accessibility, performance, and UI conventions. For custom rendering, graphics, or non-DOM interfaces, Vue may be a UI shell rather than the whole architecture.