vue

Build Vue 3 single-file components with Composition API and script setup.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/mheers/opencode-sandbox --skill vue-mheers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue
Source: https://github.com/mheers/opencode-sandbox/tree/main/skills/vue
Command: npx skills add https://github.com/mheers/opencode-sandbox --skill vue-mheers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Vue 3 app development often requires a consistent approach to using the Composition API and script setup to ensure readability and maintainability. This skill provides guidance and examples for building Vue components with proper props, emits, and reactivity patterns.

Core Features & Use Cases

  • Script Setup macros for defineProps, defineEmits, and defineModel
  • Reactivity primitives and lifecycle usage within Composition API
  • Built-in components and directives usage such as Transition, Teleport, Suspense, and KeepAlive
  • Use cases: building reusable SFCs, design system components, and complex UI with composition patterns

Quick Start

Write a Vue SFC using <script setup lang="ts"> and defineProps/defineEmits to create a typed counter component.

Frequently Asked Questions about vue

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

FAQPage Schema
How do I use defineProps and defineEmits in a Vue 3 script setup component?

Vue 3 script setup uses defineProps and defineEmits compiler macros for typed component communication. Declare them directly inside the <script setup lang="ts"> block to automatically infer types without importing them from the Vue library.

What is the best way to manage reactivity and lifecycle hooks in Vue 3 Composition API?

The best way to manage reactivity in Vue 3 Composition API is using primitives like ref and computed alongside watch. Coordinate state and lifecycle logic within the script setup block to maintain readable and maintainable UI-intensive applications.

Does Vue 3 script setup work with TypeScript for component authoring?

Yes, Vue 3 script setup works seamlessly with TypeScript for component authoring. Enforce <script setup lang="ts"> to enable type checking on macros like defineModel, defineProps, and defineEmits, ensuring strict type safety in single-file components.

Can I use built-in components like Teleport and Suspense with Vue 3 Composition API?

Yes, you can use built-in components like Teleport, Suspense, Transition, and KeepAlive with Vue 3 Composition API. They integrate directly within your script setup templates to coordinate complex UI rendering and state lifecycles.

How do I define two-way binding on a component using defineModel in Vue 3?

To define two-way binding in Vue 3, use the defineModel macro inside your script setup block. This simplifies coordinating parent-child state reactivity by replacing manual v-bind and v-on combinations for model updates.

When should I not use Vue 3 script setup for single-file components?

You should not use Vue 3 script setup if your project lacks TypeScript support or relies heavily on Options API patterns. This approach specifically enforces Composition API usage and TypeScript, making it unsuitable for legacy Vue 2 migrations.