with one click
vue-component-dev
创建组件,新建组件,生成组件
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
创建组件,新建组件,生成组件
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Converts design mockups, screenshots, or UI images into Vue 3 frontend code. Use when the user provides a design image, UI screenshot, mockup, or wireframe and asks to generate page code, implement a design, or convert a design to code.
| name | vue-component-dev |
| description | 创建组件,新建组件,生成组件 |
Components live under src/components/<component-name>/Index.vue. Use kebab-case for directory names.
src/components/
my-component/
Index.vue # Main component entry
components/ # Sub-components (optional)
SubPart.vue
<template>
<!-- template -->
</template>
<script setup lang="ts">
// script
</script>
<style lang="less" scoped>
/* styles */
</style>
Inside <script setup lang="ts">, follow this strict order:
defineOptions({ name: 'ComponentName' }) (if needed)defineProps with interface + withDefaultsdefineEmits with type aliasdefineModel (if needed)defineSlots (if needed)useI18n, useRouter, etc.)onMounted, onBeforeUnmount, etc.)defineExpose (if needed)interface Props {
title?: string;
count?: number;
disabled?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
title: '',
count: 0,
disabled: false,
});
type Emits = (e: 'change', value: string) => void;
const emit = defineEmits<Emits>();
Multiple events:
type Emits = {
(e: 'change', value: string): void;
(e: 'update', id: number): void;
};
Enforced by ESLint. Follow this sequence:
vue, lodash, tippy.js)@blueking/*@services/*@hooks@router@stores@common/*@components/*@views/*@utils@helper/*@types@locales/*@styles/*@images/*v-forv-if / v-else-if / v-else / v-showidref / keyv-slotv-modelv-* directives@event listenerslang="less" (or postcss for global utility components)scoped unless styles must leak intentionallydbm- or component-specific prefix!important; use specificity or BEM nestingThe project auto-imports Vue APIs (ref, computed, watch, onMounted, etc.) — no need to import them explicitly.
Only import non-auto-imported items.
Before finishing a component:
interface + withDefaultstype aliasany types — use unknown or concrete typeslang="less" with scoped (unless intentional)onBeforeUnmount (tippy, observers, timers, etc.)