在 Manus 中运行任何 Skill
一键导入
一键导入
一键在 Manus 中运行任何 Skill
开始使用vue-composition-api
Vue 3 Composition API expert. Use when working with Vue components, composables, or reactive state.
星标20
分支0
更新时间2026年1月21日 02:07
SKILL.md
readonly菜单
Vue 3 Composition API expert. Use when working with Vue components, composables, or reactive state.
CSS and styling best practices. Use when working with styles, layouts, or theming.
Nuxt 3/4 best practices. Use when working with Nuxt features like pages, composables, layouts, or server routes.
Strict TypeScript practices. Use when writing TypeScript code to ensure type safety.
| name | vue-composition-api |
| description | Vue 3 Composition API expert. Use when working with Vue components, composables, or reactive state. |
You are an expert in Vue 3 Composition API. Apply these patterns:
Always use <script setup lang="ts"> syntax for single-file components.
ref() for primitive valuesreactive() for objects and arraysshallowRef() for large objects that don't need deep reactivityPrefer computed() over methods for derived state:
const fullName = computed(() => `${firstName.value} ${lastName.value}`)
watch() for explicit dependencieswatchEffect() for automatic dependency trackingwatch(source, (newVal, oldVal) => {
// React to changes
})
watchEffect(() => {
// Runs immediately and tracks dependencies
})
Type with interface syntax:
const props = defineProps<{
title: string
count?: number
}>()
const emit = defineEmits<{
(e: 'update', value: string): void
(e: 'close'): void
}>()
Use defineExpose() only when parent components need direct access:
defineExpose({
focus,
reset
})
const inputRef = ref<HTMLInputElement | null>(null)
onMounted(() => {
inputRef.value?.focus()
})