vue

Vue 3 Composition API conventions, script setup macros, reactivity patterns, and component best practices. Use when writing .vue files, creating composables, working with defineProps/defineEmits/defineModel, or using Tailwind in Vue templates.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "vue" with this command: npx skills add marsidev/skills/marsidev-skills-vue

Vue 3 Development

Based on Vue 3.5+. Always use Composition API with <script setup lang="ts">.

Preferences

  • Always <script setup lang="ts"> — no Options API
  • TypeScript for all component logic
  • Prefer shallowRef over ref when deep reactivity is not needed
  • Prefer Tailwind utility classes over custom CSS
  • Avoid reactive props destructure — use const props = defineProps<Props>()
  • Function declarations (function handleClick()) over arrow functions for component methods
  • Early returns over if/else blocks

Quick Template

<script setup lang="ts">
import { ref, computed, onMounted } from 'vue'

const props = defineProps<{
  title: string
  count?: number
}>()

const emit = defineEmits<{
  update: [value: string]
}>()

const model = defineModel<string>()

const doubled = computed(() => (props.count ?? 0) * 2)

onMounted(() => {
  // ...
})
</script>

<template>
  <div>{{ title }} - {{ doubled }}</div>
</template>

References

Load only the file relevant to your current task:

Conventions

TopicDescriptionReference
Code OrganizationScript setup ordering, template rules, styling, naming conventionsconventions

API

TopicDescriptionReference
Script Setup MacrosdefineProps, defineEmits, defineModel, defineExpose, defineOptions, defineSlots, genericsmacros
Reactivity & Lifecycleref, shallowRef, computed, watch, watchEffect, composable patterns, effect scopereactivity

Patterns

TopicDescriptionReference
Component PatternsAsync emit callbacks, v-model patterns, slot usage, loading statespatterns

Gotchas

TopicDescriptionReference
Common PitfallsReactivity traps, computed mistakes, watcher timing, TypeScript, Tailwind, performancegotchas

When to Load

Do not load all references at once.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

vue

No summary provided by upstream source.

Repository SourceNeeds Review
-8.4K
antfu
General

vue

No summary provided by upstream source.

Repository SourceNeeds Review
General

vue

No summary provided by upstream source.

Repository SourceNeeds Review