vue

Guide Vue 3 Composition API and script setup for TypeScript SFCs.

2|Updated Jan 5, 2024
One-click install
npx skills add https://github.com/wilfriedago/dotfiles --skill vue-wilfriedago
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue
Source: https://github.com/wilfriedago/dotfiles/tree/main/agents/skills/vue
Command: npx skills add https://github.com/wilfriedago/dotfiles --skill vue-wilfriedago

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers efficiently build modern Vue.js applications by leveraging the Composition API, script setup, and built-in features for enhanced performance and maintainability.

Core Features & Use Cases

  • Composition API: Utilize ref, computed, watch, and lifecycle hooks for organized, reusable logic.
  • Script Setup: Write cleaner, more performant Vue Single File Components (SFCs) with <script setup lang="ts">.
  • Built-in Components: Master Transition, Teleport, Suspense, and KeepAlive for advanced UI patterns.
  • Use Case: When creating a new Vue 3 component, use this Skill to quickly implement reactive state, handle props and emits using <script setup>, and integrate animations with Transition.

Quick Start

Use the vue skill to define a component with a reactive counter and a button to increment it.

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 using Vue 3 script setup?

To define props and emits in Vue 3 script setup, use the compiler macros defineProps and defineEmits directly within the <script setup> block for type-safe component communication.

What is the difference between ref and shallowRef in Vue 3 reactivity?

In Vue 3 reactivity, ref deeply tracks changes to its object value, while shallowRef only tracks changes to the .value reference itself, optimizing performance for large data structures.

How do I use Teleport and Suspense components in a Vue 3 SFC?

To use Teleport and Suspense in a Vue 3 SFC, wrap your template content with these built-in components to render DOM nodes outside the component hierarchy and manage asynchronous component loading states.

Can I build TypeScript Vue 3 components with the Composition API?

Yes, you can build TypeScript Vue 3 components by using <script setup lang="ts"> alongside Composition API primitives like ref and computed to ensure strict type safety and maintainable logic.

What is the best way to handle two-way binding in Vue 3 script setup?

The best way to handle two-way binding in Vue 3 script setup is using the defineModel macro, which simplifies parent-child v-model communication without manual props and emits configuration.