vue

Guide Vue 3 Composition API usage with ref, reactive, and script setup.

624|138|Updated Aug 7, 2023
One-click install
npx skills add https://github.com/oyjt/uniapp-vue3-template --skill vue-oyjt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue
Source: https://github.com/oyjt/uniapp-vue3-template/tree/main/.cursor/skills/vue
Command: npx skills add https://github.com/oyjt/uniapp-vue3-template --skill vue-oyjt

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Vue 3 development with the Composition API and reactivity model can be challenging to learn and apply consistently across projects. This Skill provides a structured, reference-driven guide to accelerate learning and practical usage.

Core Features & Use Cases

  • Comprehensive coverage of reactivity primitives (ref, reactive, computed, watch) and the Composition API patterns (script setup, defineProps, defineEmits, defineModel).
  • Clear guidance for composing components, props, slots, v-models, lifecycle hooks, and composables to build scalable UI architectures.
  • Real-world use cases and best practices to speed up development, improve type safety with TypeScript, and align with Vue 3 docs standards.

Quick Start

Start by reading the core references (core-reactivity.md, components-props.md, components-slots.md) and try a small example: create a component that uses script setup, ref state, and a prop, then render it with v-model if needed.

Frequently Asked Questions about vue

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

FAQPage Schema
How do I use Vue 3 Composition API with script setup to manage reactive state?

Vue 3 Composition API uses script setup with ref and reactive primitives to manage reactive state. You define state using ref for primitives and reactive for objects, exposing them directly in the template for reactive UI updates.

What is the best way to define props and emits in Vue 3 components using TypeScript?

The best way to define props and emits in Vue 3 is using defineProps and defineEmits macros within script setup. This approach provides full TypeScript integration, ensuring type-safe component interfaces and scalable UI architectures.

How does v-model work with Vue 3 components and defineModel?

Vue 3 v-model uses the defineModel macro within script setup to create two-way binding for components. It simplifies prop and emit synchronization, allowing seamless parent-child data flow without manual event handling.

When should I use provide/inject versus composables for state management in Vue 3?

Use provide/inject for passing state deeply through Vue 3 component trees without prop drilling, while composables encapsulate reusable reactive logic. Both patterns leverage Vue 3 reactivity for scalable UI architectures.

How do I use Vue 3 slots to build flexible component templates?

Vue 3 slots allow parent components to inject content into child component templates. By defining slot outlets in components, you create flexible and reusable UI structures for scalable Vue 3 architectures.