vue3-components

Standardize Vue 3 component APIs with props, emits, defineModel, slots, and provide/inject for SSR.

3|Updated Jan 14, 2023
One-click install
npx skills add https://github.com/e-xode/vue-ssr --skill vue3-components
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vue3-components
Source: https://github.com/e-xode/vue-ssr/tree/main/.claude/skills/vue3-components
Command: npx skills add https://github.com/e-xode/vue-ssr --skill vue3-components

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents brittle component interfaces by giving you consistent rules for how Vue 3 components expose inputs, outputs, slot content, and shared subtree context in a Vue SSR project.

Core Features & Use Cases

  • Props + validation (object syntax): Define strict, developer-friendly component inputs with clear defaults and one-way data flow.
  • Emits + event validation: Declare every event your component can send to avoid unintended fallthrough listeners and improve reliability.
  • v-model contract via defineModel: Implement component two-way bindings cleanly without desynchronizing parent state.
  • Slots (including scoped/conditional slots): Compose reusable UI by letting parents inject markup and access child-owned data safely.
  • provide/inject for subtree context: Share reactive context downward without prop drilling, while keeping app-wide state in Pinia.
  • SSR-safe component patterns: Ensure props/events/slots/provides are safe during renderToString by avoiding browser-only access at setup time.
  • Dynamic/async components: Switch components at runtime and lazy-load heavy components with SSR-aware behavior.

Quick Start

Use this skill when you are designing a new reusable component contract and want to define its props, emits, slots, and v-model binding so it works predictably in Vue SSR.

Frequently Asked Questions about vue3-components

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

FAQPage Schema
How do I define Vue 3 component props and emits for SSR?

Vue 3 component props and emits for SSR require object-syntax prop validation and explicitly declared emits to maintain a strict one-way data flow and prevent unintended fallthrough listeners during server-side rendering.

What is the best way to implement v-model in a Vue 3 custom component?

The best way to implement v-model in a Vue 3 custom component is using defineModel to establish a clean two-way binding contract without desynchronizing parent state. This standardizes data flow predictably.

How does provide/inject work for sharing subtree context in Vue 3?

Provide/inject in Vue 3 shares reactive subtree context downward without prop drilling, allowing deep child components to access shared state while keeping app-wide state management separate in Pinia.

Can I use dynamic and async components safely during Vue SSR?

Yes, you can use dynamic and async components safely during Vue SSR by applying SSR-aware patterns that lazy-load heavy components at runtime while maintaining safe template and logic boundaries during server rendering.

Why do my Vue 3 components break during renderToString server-side rendering?

Vue 3 components break during renderToString when browser-only APIs are accessed at setup time. Ensuring SSR-safe template and logic boundaries prevents this by avoiding browser-only access during the initial server render.

How do I use scoped slots to compose reusable Vue 3 component UI?

To compose reusable Vue 3 component UI with scoped slots, let parent components inject markup into child components while safely exposing child-owned data, enabling flexible content composition patterns across your application.