vue
Installation
SKILL.md
Vue
Based on Vue 3.5. Always use Composition API with
<script setup>.
Preferences
- Prefer JavaScript over TypeScript
- Prefer
<script setup>over<script setup lang="ts"> - Strictly follow the
<template>tag at the top, the<script>tag in the middle, and the<style>tag at the bottom. - For performance, prefer
shallowRefoverrefif deep reactivity is not needed - Always use Composition API over Options API
- Discourage using Reactive Props Destructure
Core
| Topic | Description | Reference |
|---|---|---|
| Script Setup & Macros | <script setup>, defineProps, defineEmits, defineModel, defineExpose, defineOptions, defineSlots, generics |
script-setup-macros |
| Reactivity & Lifecycle | ref, shallowRef, computed, watch, watchEffect, effectScope, lifecycle hooks, composables | core-new-apis |