>>
stars: 0
forks: 0
watches: 0
last updated: 2026-03-04 07:03:27
Component Documentation Generator
This skill generates Vue component usage documentation for joyadata component library.
When to Use
Triggered when:
- User uses components with
joyadata-xxxprefix (e.g.,<joyadata-table>,<joyadata-form>,<joyadata-dialog>, etc.) - User asks about joyadata components usage
- User asks for component documentation
- User asks about project setup / environment / initialization
- User asks about API requests / axios usage
- User provides MD file and wants usage instructions
Supported Frameworks
- Vue 2.x (based on Element UI)
- Vue 3.x (coming soon)
Documentation Structure
.trae/skills/component-doc-generator/
├── SKILL.md # Main skill file
└── docs/ # Component documentation folder
├── joyadata-setup.md # 项目环境搭建指南
├── joyadata-table.md # 表格组件
├── joyadata-form.md # 表单组件
├── joyadata-dialog.md # 弹框组件
├── joyadata-menu.md # 菜单组件
├── joyadata-aside.md # 目录树组件
├── joyadata-search.md # 搜索组件
├── joyadata-tree.md # 树组件
└── ...
Built-in Documentation
快速入门
| Document | Description |
|---|---|
| joyadata-setup | 项目环境搭建、初始化、接口规范 |
组件文档
| Component | Description |
|---|---|
| joyadata-table | 表格组件,基于 el-table 封装 |
| joyadata-form | 表单组件,基于 el-form 封装 |
| joyadata-dialog | 弹框组件,基于 el-dialog 封装 |
| joyadata-menu | 菜单组件,基于 el-menu 封装 |
| joyadata-aside | 目录树组件,基于 el-tree 封装 |
| joyadata-search | 搜索组件,用于页面搜索和操作 |
| joyadata-tree | 树组件,基于 el-tree 封装 |
Usage
For Built-in Components
When user asks about a specific joyadata-xxx component:
- Check if there's a corresponding MD file in the
docs/folder - Read the documentation file
- Present structured documentation to user including:
- Basic usage
- Props (all attributes)
- Events
- Methods
- Code examples
- Important notes
For Unknown Components
If user asks about a component that doesn't have documentation:
- Ask user to provide the component's MD documentation file
- Or generate generic documentation based on Vue component patterns
- Suggest adding new documentation to docs folder
For New Components
To add new component documentation:
- Create new MD file in
docs/folder:docs/joyadata-xxx.md - Include all component details (props, events, slots, examples)
- The skill will automatically find and use it
Processing Steps
- Parse user's question to identify the component name
- Check docs folder for component-specific MD file
- If found, read and parse the documentation
- If not found, ask user to provide MD file
- Present structured documentation with examples
Documentation Template
Each component documentation should include:
# Component Name
**Description**: Brief description of the component
## Basic Usage
Code example for basic usage
## Props
| Prop Name | Type | Default | Description |
|-----------|------|---------|-------------|
## Events
| Event Name | Parameters | Description |
|------------|------------|-------------|
## Methods
| Method Name | Parameters | Description |
|-------------|------------|-------------|
## Important Notes
Key points to remember
Guidelines
- Language: Output in the same language as user's request (Chinese)
- Completeness: Include all props, events, slots, and methods
- Examples: Provide practical, runnable code examples
- Best Practices: Add tips and common use cases
- Code Formatting: Use proper Vue/HTML code blocks
Common Component Patterns
Table + Form + Dialog
<!-- Search -->
<joyadata-search :operation="operation" :parmas="parmas" />
<!-- Table -->
<joyadata-table ref="tableRef" :column="column" :mock-data="data" />
<!-- Dialog + Form -->
<joyadata-dialog ref="dialog" title="标题" @affirm="affirm">
<joyadata-form ref="formDom" :main="main" :rules="rules" />
</joyadata-dialog>
Sidebar + Tree
<!-- Menu -->
<joyadata-menu :menu-data="menuData" />
<!-- Tree/Aside -->
<joyadata-aside :nav-val="treeData" @changeAside="changeAside" />
