frontend-vue-development

10
5
Source

前端 Vue 开发规范,涵盖 Vue 2/3 组件开发、Vuex 状态管理、路由配置、组件通信、样式规范、国际化。当用户进行前端开发、编写 Vue 组件、处理状态管理或实现页面交互时使用。

Install

mkdir -p .claude/skills/frontend-vue-development && curl -L -o skill.zip "https://mcp.directory/api/skills/download/2149" && unzip -o skill.zip -d .claude/skills/frontend-vue-development && rm skill.zip

Installs to .claude/skills/frontend-vue-development

About this skill

前端 Vue 开发

Quick Reference

技术栈:Vue 2.7 + Vuex 3.6 + Vue Router 3.6 + bk-magic-vue 2.5
文件命名:kebab-case.vue(如 group-table.vue)
缩进:4 空格 | 无分号 | 无拖尾逗号 | HTML 双引号
API 调用:vue.$ajax.get/post/put/delete

最简示例

<template>
    <div class="pipeline-list">
        <bk-table :data="pipelines" v-loading="isLoading">
            <bk-table-column prop="name" label="名称"></bk-table-column>
        </bk-table>
    </div>
</template>

<script>
export default {
    data() {
        return {
            pipelines: [],
            isLoading: false
        }
    },
    created() {
        this.fetchPipelines()
    },
    methods: {
        async fetchPipelines() {
            this.isLoading = true
            try {
                const res = await this.$ajax.get('/api/user/pipelines')
                this.pipelines = res.data || []
            } finally {
                this.isLoading = false
            }
        }
    }
}
</script>

<style lang="scss" scoped>
.pipeline-list {
    padding: 20px;
}
</style>

When to Use

  • 开发 Vue 组件
  • 管理 Vuex 状态
  • 调用后端 API
  • 处理页面交互

When NOT to Use

  • 后端 API 开发 → 使用 01-backend-microservice-development
  • 构建机 Agent → 使用 05-go-agent-development

前端应用结构

src/frontend/
├── devops-pipeline/      # 流水线应用
├── devops-atomstore/     # 研发商店应用
├── devops-manage/        # 管理应用
├── bk-pipeline/          # 流水线组件库
└── bk-permission/        # 权限组件库

ESLint 核心规则

{
    'indent': ['error', 4],                // 4 空格缩进
    'semi': ['error', 'never'],            // 禁用分号
    'comma-dangle': ['error', 'never'],    // 禁用拖尾逗号
    'vue/html-quotes': ['error', 'double'],// HTML 双引号
    'vue/no-v-html': 'error',              // 禁止 v-html(防 XSS)
    'no-console': 'error'                  // 禁止 console
}

组件选项顺序

export default {
    components: { },  // 1. 组件注册
    mixins: [ ],      // 2. 混入
    props: { },       // 3. Props
    data() { },       // 4. 响应式数据
    computed: { },    // 5. 计算属性
    watch: { },       // 6. 侦听器
    created() { },    // 7. 生命周期钩子
    mounted() { },
    methods: { }      // 8. 方法
}

Props 定义

props: {
    resourceType: {
        type: String,
        default: ''
    },
    options: {
        type: Array,
        default: () => []  // 对象/数组使用工厂函数
    }
}

API 调用模式

// GET
this.$ajax.get(`${prefix}/user/pipelines`)

// POST
this.$ajax.post(`${prefix}/user/pipelines`, data)

// 错误处理
this.$ajax.get(url)
    .then(res => this.data = res.data)
    .catch(err => {
        if ([404, 403].includes(err.code)) {
            this.errorCode = err.code
        }
    })
    .finally(() => this.isLoading = false)

Vuex 使用

// store/pipeline.js
export const actions = {
    getPipelineList({ commit }, { projectId }) {
        return vue.$ajax.get(`/api/user/projects/${projectId}/pipelines`)
    }
}

// 组件中使用
import { mapActions } from 'vuex'

methods: {
    ...mapActions('pipeline', ['getPipelineList']),
    async fetchData() {
        this.list = await this.getPipelineList({ projectId: this.projectId })
    }
}

方法命名约定

类型命名模式示例
事件处理handle*handleClick()
初始化init*initData()
格式化*FormatterstatusFormatter()

Checklist

开发组件前确认:

  • 文件命名使用 kebab-case
  • 遵循 ESLint 规则(4 空格、无分号)
  • Props 使用完整定义(type + default)
  • 对象/数组 Props 使用工厂函数
  • 禁止使用 v-html
  • 使用 scoped 样式

project-module-architecture

TencentBlueKing

Project 项目管理模块架构指南,涵盖项目 CRUD、成员管理、项目配置、标签管理、项目迁移。当用户开发项目管理功能、处理项目成员、配置项目属性或实现项目相关逻辑时使用。

126

managing-devops-pipeline

TencentBlueKing

管理蓝盾流水线的构建操作,包括查询构建历史、获取启动参数、查看构建状态、启动构建。当用户提及流水线、构建、部署、CI/CD、蓝盾或需要触发构建任务时使用。

244

microservice-infrastructure

TencentBlueKing

微服务基础设施指南,涵盖条件配置、事件驱动架构、服务间通信、国际化与日志等微服务架构的核心基础设施。当用户实现服务间调用、配置多环境、实现异步通信、处理国际化或规范日志输出时使用。

144

artifactory-module-architecture

TencentBlueKing

Artifactory 制品库模块架构指南,涵盖制品上传下载、存储后端适配、制品元数据、清理策略、权限控制。当用户开发制品库功能、处理制品存储、配置清理策略或实现制品管理时使用。

194

unit-testing

TencentBlueKing

单元测试编写指南,涵盖 JUnit5/MockK 使用、测试命名规范、Mock 技巧、测试覆盖率要求、TDD 实践。当用户编写单元测试、Mock 依赖、提高测试覆盖率或进行测试驱动开发时使用。

203

worker-module-architecture

TencentBlueKing

Worker 构建执行器模块架构指南,涵盖插件执行引擎、任务分发、日志上报、制品上传、Worker 生命周期。当用户开发 Worker 功能、实现插件执行、处理任务分发或优化执行器性能时使用。

73

You might also like

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

2,8862,530

pdf-to-markdown

aliceisjustplaying

Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.

3,8181,662

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

2,1551,643

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

2,2691,469

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

2,4711,225

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

1,960969