script-setup
OfficialLean Vue 3 SFCs with script setup.
Software Engineering#typescript#vue#vue3#composition-api#script-setup#defineProps#single-file-component
AuthorPatternsDev
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Script setup in Vue 3 offers a concise way to use the Composition API, but teams may struggle with ergonomics and consistency. This guide helps adopt the pattern to reduce boilerplate and improve readability across components.
Core Features & Use Cases
- Simplified component scripts: declare reactive state, props, and emits inside a single script setup block.
- Automatic template bindings: top-level bindings are available in the template without an explicit return.
- Type-safe props and events: use defineProps and defineEmits with optional withDefaults for TypeScript.
- Best practices: guidelines for organizing composition logic and component structure.
Quick Start
Start by converting a typical Vue 3 component to use the <script setup> block and progressively adopt defineProps and defineEmits.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: script-setup Download link: https://github.com/PatternsDev/skills/archive/main.zip#script-setup Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.