vue

Author Vue 3 single-file components using the Composition API with script setup.

2|Updated Jun 13, 2023
One-click install
npx skills add https://github.com/joaoprocopio/tooling --skill vue-joaoprocopio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue
Source: https://github.com/joaoprocopio/tooling/tree/main/skills/vue
Command: npx skills add https://github.com/joaoprocopio/tooling --skill vue-joaoprocopio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Vue 3 SFC development with the Composition API, script setup, and built-in components can be verbose and error-prone; this Skill consolidates patterns and best practices to speed up development.

Core Features & Use Cases

  • Composition API usage with script setup, defineProps/defineEmits/defineModel, and reusable patterns.
  • Built-in components and directives (Transition, Teleport, Suspense, KeepAlive) for common UI cases.
  • Use Case: create a Vue 3 single-file component that defines props, emits, and reactive state with script setup, then apply transitions for UI polish.

Quick Start

Create a new Vue 3 SFC using <script setup lang="ts">, define props with defineProps, defineEmits, and use a built-in component like Transition.

Frequently Asked Questions about vue

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

FAQPage Schema
How do I define props and emits in a Vue 3 single-file component using script setup?

To define props and emits in Vue 3 SFCs, use the compiler macros `defineProps` and `defineEmits` directly within a `<script setup>` block. This approach enables type-safe component contracts without separate import statements.

What is the best way to manage reactive state with the Vue 3 Composition API?

The best way to manage reactive state with the Vue 3 Composition API is by using `<script setup>` to encapsulate reactive variables and computed properties, creating reusable patterns for efficient single-file component development.

When should I use built-in components like KeepAlive and Teleport in Vue 3?

Use built-in components like KeepAlive and Teleport in Vue 3 to manage common UI cases such as preserving component state or rendering DOM nodes outside the current hierarchy. Apply them alongside Transition for UI polish.

Can I use TypeScript with Vue 3 Composition API patterns?

Yes, you can use TypeScript with Vue 3 Composition API patterns by adding `lang="ts"` to your `<script setup>` tag. This enables type checking for defineProps, defineEmits, and reactive state across your project.

Why does defining a Vue 3 SFC without script setup lead to verbose code?

Defining a Vue 3 SFC without script setup leads to verbose code because it requires manual setup function returns and explicit expose statements. The `<script setup>` syntax consolidates patterns to reduce this boilerplate.

Does the Vue 3 Composition API support defineModel for two-way binding?

Yes, the Vue 3 Composition API supports `defineModel` for two-way binding. This compiler macro simplifies reactive state management and prop definitions within `<script setup>` for reusable components.