Esta página se muestra en inglés. Una traducción al español está en curso.
SkillsApr 13, 2026·3 min de lectura

Vue.js — The Progressive JavaScript Framework

Vue.js is a progressive framework for building user interfaces. It features an approachable core with an incrementally adoptable ecosystem — from simple script includes to full-featured SPA development with Composition API, reactivity, and single-file components.

Listo para agents

Instalación con revisión previa

Este activo requiere revisión. El prompt copiado pide dry-run, muestra escrituras y continúa solo tras confirmación.

Needs Confirmation · 64/100Política: confirmar
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
step-1.md
Comando con revisión previa
npx -y tokrepo@latest install 6935d236-3702-11f1-9bc6-00163e2b0d79 --target codex

Primero dry-run, confirma las escrituras y luego ejecuta este comando.

TL;DR
Vue.js offers an approachable core with incremental adoption from simple widgets to full-scale SPAs.
§01

What it is

Vue.js is a progressive JavaScript framework for building user interfaces. It provides a reactive data binding system, component architecture, and a rich ecosystem including Vue Router for navigation and Pinia for state management. Vue can be used as a lightweight library for enhancing static pages or as a full framework for single-page applications.

Vue targets frontend developers at all skill levels. Its gentle learning curve makes it accessible to beginners, while its Composition API and TypeScript support satisfy the needs of large-scale application development.

§02

How it saves time or tokens

Vue's single-file component format (.vue files) co-locates template, script, and style in one file, reducing context switching during development. The Composition API enables logic reuse through composable functions, eliminating the need to restructure components when sharing behavior.

The Vue CLI and Vite-based scaffolding tool (create-vue) set up a production-ready project with routing, state management, and build optimization in a single command. This eliminates hours of boilerplate configuration.

§03

How to use

  1. Create a new Vue project:
npm create vue@latest my-app
cd my-app
npm install
npm run dev
  1. Edit src/App.vue to build your interface:
<script setup>
import { ref } from 'vue'
const count = ref(0)
</script>

<template>
  <button @click="count++">Count: {{ count }}</button>
</template>
  1. Build for production:
npm run build
§04

Example

<script setup lang="ts">
import { ref, computed } from 'vue'

interface Todo {
  id: number
  text: string
  done: boolean
}

const todos = ref<Todo[]>([
  { id: 1, text: 'Learn Vue 3', done: false },
  { id: 2, text: 'Build an app', done: false }
])

const remaining = computed(() =>
  todos.value.filter(t => !t.done).length
)

function toggle(todo: Todo) {
  todo.done = !todo.done
}
</script>

<template>
  <h2>Todos ({{ remaining }} remaining)</h2>
  <ul>
    <li v-for="todo in todos" :key="todo.id">
      <input type="checkbox" :checked="todo.done" @change="toggle(todo)" />
      {{ todo.text }}
    </li>
  </ul>
</template>

This demonstrates Vue's reactivity system, computed properties, list rendering, and TypeScript integration in a single-file component.

§05

Related on TokRepo

§06

Common pitfalls

  • Mixing Options API and Composition API in the same project creates inconsistency. Pick one style and apply it consistently. The Composition API with <script setup> is the recommended approach for new projects.
  • Vue's reactivity system tracks property access. Destructuring reactive objects loses reactivity. Use toRefs() when destructuring props or store state.
  • Large Vue applications need code splitting. Without lazy-loaded routes (defineAsyncComponent and dynamic imports), the initial bundle grows large and slows page load.

Preguntas frecuentes

What is the difference between Vue 2 and Vue 3?+

Vue 3 introduced the Composition API, improved reactivity with Proxy-based tracking, better TypeScript support, Teleport and Suspense components, and significant performance improvements. Vue 2 reached end of life in December 2023. New projects should use Vue 3.

How does Vue compare to React?+

Vue uses single-file components with templates by default, while React uses JSX. Vue provides built-in reactivity, transitions, and a router as official packages. React's ecosystem relies more on third-party libraries. Vue has a gentler learning curve; React has a larger ecosystem and job market.

Does Vue support server-side rendering?+

Yes. Nuxt is the official Vue framework for SSR. It provides file-based routing, auto-imports, SEO optimization, and hybrid rendering modes. For basic SSR without Nuxt, Vue provides the @vue/server-renderer package.

Can I use Vue with TypeScript?+

Yes. Vue 3 is written in TypeScript and provides first-class TypeScript support. The Composition API with <script setup lang='ts'> enables full type inference for props, events, slots, and composables. Volar is the recommended VS Code extension for Vue TypeScript support.

What state management should I use with Vue?+

Pinia is the officially recommended state management library for Vue 3. It replaced Vuex as the default choice. Pinia provides a simpler API, better TypeScript support, and devtools integration. For simple applications, Vue's built-in reactivity with provide/inject may be sufficient.

Referencias (3)

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados