vue

Guide Vue 3 developers in using Composition API and script setup for scalable components.

Updated Nov 29, 2025
One-click install
npx skills add https://github.com/hightemp/openrouter-chat-app-vue --skill vue-hightemp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue
Source: https://github.com/hightemp/openrouter-chat-app-vue/tree/main/.github/skills/vue
Command: npx skills add https://github.com/hightemp/openrouter-chat-app-vue --skill vue-hightemp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Vue 3 development often struggles with structuring components and mastering the Composition API alongside the script setup syntax. This guide helps engineers consistently apply modern Vue 3 patterns to build maintainable, scalable UIs.

Core Features & Use Cases

  • Script Setup & Macros: use <script setup>, defineProps, defineEmits, defineModel, and defineExpose for concise, typed components.
  • Reactivity & Lifecycle: master ref, reactive, computed, watch, and lifecycle hooks to build robust components.
  • Built-in Components & Directives: leverage Transition, Teleport, Suspense, KeepAlive, and v-memo for polished UX.
  • Use Cases: rapidly prototype SFCs, incrementally migrate from Options API, and enforce consistent prop and event structures across projects.

Quick Start

Install a Vue 3 project and create a single-file component using <script setup lang="ts"> with defineProps and defineEmits to see reactive state in action.

Frequently Asked Questions about vue

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use script setup and macros in Vue 3 single-file components?

Vue 3 script setup uses compiler macros like defineProps, defineEmits, defineModel, and defineExpose to build concise, typed components. You apply these directly inside the <script setup> block to structure props and reactive state without manual exports.

What is the best way to migrate from Options API to Composition API in Vue 3?

Migrating from Options API to Composition API involves restructuring components using ref, reactive, computed, and watch. You incrementally replace data and methods with reactive variables and functions, leveraging lifecycle hooks within script setup for maintainable, scalable UIs.

How do Transition, Teleport, and Suspense components work in Vue 3?

Vue 3 built-in components like Transition, Teleport, and Suspense manage complex UI states. Transition handles enter and leave animations, Teleport renders DOM nodes outside the component tree, and Suspense coordinates async component loading for polished user experiences.

Can I use KeepAlive and v-memo to optimize Vue 3 component performance?

KeepAlive caches component instances to preserve state and avoid re-rendering, while v-memo skips re-rendering elements unless dependencies change. You apply these built-in features in Vue 3 to optimize rendering performance for dynamic views.

Do I need TypeScript to use defineProps and defineEmits in Vue 3?

TypeScript is not required to use compiler macros like defineProps and defineEmits in Vue 3. You can apply script setup in plain JavaScript, but adding lang="ts" enables type inference for strongly typed component props and emitted events.

When should I not use Vue 3 Composition API for web development?

You should avoid Vue 3 Composition API when migrating large legacy codebases heavily reliant on Options API patterns without dedicated refactoring time. If your project lacks strict component structure requirements, the added reactivity complexity might not justify the migration.