---
stable_id: skills/skills-sh-antfu-skills-vue
type: skills
title: skills-sh-antfu-skills-vue
summary: >-
  ---

  name: script-setup-macros

  description: Vue 3 script setup syntax and compiler macros for defining props,
  emits, models, and more

  ---

  # Script Setup & Macros

  `<script setup>` is the recommended syntax for Vue SFCs with Composition API.
  It provides better runtime performance and IDE type inference.

  ## Basic Syntax

  ```vue

  <script setup lang="ts">

  // Top-level bindings are exposed to template
tags:
  - skills-sh
  - skills-sh-all-time
source_url: https://raw.githubusercontent.com/antfu/skills/HEAD/skills/vue/references/script-setup-macros.md
license: ""
upstream_ref: https://skills.sh/antfu/skills/vue
github_stars: 4218
github_forks: 211
github_is_organization: false
retrieved_at: 2026-06-11T08:33:21.734Z
content_sha256: ad47db85f8fbda6c055cedcc1d4175cd79d414e9be3ebf1e631d0e493eb4480a
---
