vue

Writes Vue 3 SFCs using the Composition API with defineProps, defineEmits, and script setup.

5.7k|318|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/antfu/skills --skill vue-antfu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue
Source: https://github.com/antfu/skills/tree/main/skills/vue
Command: npx skills add https://github.com/antfu/skills --skill vue-antfu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Vue 3 development often suffers from scattered patterns for component design. This Skill provides a cohesive approach to using the Composition API, script setup macros, and built-in components to create maintainable Vue SFCs.

Core Features & Use Cases

  • Composition API-first: Write components with ref, reactive, computed, and lifecycle hooks using the script setup syntax.
  • Props, Emits & Models: Use defineProps, defineEmits, and defineModel to type-check and streamline data flow.
  • Built-in Components & Directives: Leverage Transition, Teleport, Suspense, KeepAlive, and common directives for richer UIs.
  • Use Case: Build a reusable form component that validates props, emits events, and uses transitions for UX polish.

Quick Start

Create a Vue SFC with a script setup block, declare props via defineProps, and set up emits via defineEmits to create a small interactive component.

Frequently Asked Questions about vue

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

FAQPage Schema
How do I write Vue 3 components using the Composition API?

Write Vue 3 components using the Composition API by leveraging script setup macros like defineProps and defineEmits alongside ref and reactive to manage state and data flow. This approach provides a cohesive pattern for building maintainable single-file components.

What is the best way to handle props and emits in Vue 3 with TypeScript?

Handle props and emits in Vue 3 with TypeScript by using defineProps and defineEmits compiler macros. These macros provide type-checking and streamline component data flow directly within your script setup block without manual imports.

How do I use defineModel for two-way binding in Vue 3?

Use defineModel for two-way binding in Vue 3 by declaring the macro within your script setup block. It streamlines reactive data flow between parent and child components, replacing manual props and emits for v-model implementations.

Can I use built-in components like Transition and Teleport with script setup?

You can use built-in components like Transition, Teleport, Suspense, and KeepAlive with script setup. Leverage these built-in Vue features and common directives to create richer UIs and manage dynamic rendering seamlessly within your SFCs.

How do I create a reusable form component in Vue 3?

Create a reusable form component in Vue 3 by combining defineProps for validation, defineEmits for events, and Transition for UX polish. Use the Composition API to encapsulate interactive logic within a single-file component.