When to use this skill
Use this skill whenever the user wants to:
- Install and set up Element Plus in a Vue 3 project
- Use Element Plus components in Vue 3 applications
- Configure Element Plus (global config, i18n, theme, etc.)
- Use form components (Button, Input, Form, etc.)
- Use data display components (Table, Card, etc.)
- Use feedback components (Message, Notification, Dialog, etc.)
- Use navigation components (Menu, Tabs, etc.)
- Customize component styles and themes
- Handle component events
- Understand Element Plus API and methods
- Troubleshoot Element Plus issues
How to use this skill
This skill is organized to match the Element Plus official documentation structure (https://element-plus.org/zh-CN/, https://element-plus.org/en-US/guide/design, https://element-plus.org/en-US/component/overview). When working with Element Plus:
Identify the topic from the user's request:
- Installation/安装 →
examples/guide/installation.md
- Quick Start/快速开始 →
examples/guide/quick-start.md
- Design/设计 →
examples/guide/design.md
- Components/组件 →
examples/components/
- API/API 文档 →
api/
Load the appropriate example file from the examples/ directory:
Guide (使用指南):
examples/guide/installation.md - Installation guide
examples/guide/quick-start.md - Quick start guide
examples/guide/design.md - Design guidelines
examples/guide/i18n.md - Internationalization
examples/guide/theme.md - Theme customization
examples/guide/global-config.md - Global configuration
Components (组件):
examples/components/overview.md - Components overview
examples/components/button.md - Button component
examples/components/input.md - Input component
examples/components/form.md - Form component
examples/components/table.md - Table component
examples/components/card.md - Card component
examples/components/dialog.md - Dialog component
examples/components/message.md - Message component
examples/components/notification.md - Notification component
examples/components/menu.md - Menu component
examples/components/tabs.md - Tabs component
examples/components/date-picker.md - DatePicker component
examples/components/select.md - Select component
examples/components/switch.md - Switch component
examples/components/checkbox.md - Checkbox component
examples/components/radio.md - Radio component
examples/components/upload.md - Upload component
examples/components/pagination.md - Pagination component
examples/components/tree.md - Tree component
examples/components/tree-select.md - TreeSelect component
examples/components/transfer.md - Transfer component
examples/components/descriptions.md - Descriptions component
examples/components/avatar.md - Avatar component
examples/components/badge.md - Badge component
examples/components/tag.md - Tag component
examples/components/empty.md - Empty component
examples/components/loading.md - Loading component
examples/components/popover.md - Popover component
examples/components/tooltip.md - Tooltip component
examples/components/dropdown.md - Dropdown component
examples/components/drawer.md - Drawer component
examples/components/popconfirm.md - Popconfirm component
Follow the specific instructions in that example file for syntax, structure, and best practices
Important Notes:
- Element Plus is for Vue 3 only
- Components use Vue 3 Composition API
- Examples include both Options API and Composition API
- Each example file includes key concepts, code examples, and key points
Reference API documentation in the api/ directory when needed:
api/component-api.md - Component API reference
api/props-and-events.md - Props and events reference
api/global-config.md - Global configuration API
Use templates from the templates/ directory:
templates/installation.md - Installation templates
templates/component-usage.md - Component usage templates
templates/project-setup.md - Project setup templates
1. Understanding Element Plus
Element Plus is a Vue 3 component library that provides a rich set of UI components following Element Design principles.
Key Concepts:
- Vue 3 Support: Built for Vue 3 with Composition API
- Design System: Follows Element Design language
- Rich Components: 60+ components for various use cases
- Theme Customization: Support for theme customization
- i18n: Internationalization support
- TypeScript: Full TypeScript support
2. Installation
Using npm:
npm install element-plus
Using yarn:
yarn add element-plus
Using pnpm:
pnpm add element-plus
3. Basic Setup
Full Import:
import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
const app = createApp(App)
app.use(ElementPlus)
app.mount('#app')
On-Demand Import:
import { ElButton, ElInput } from 'element-plus'
import 'element-plus/es/components/button/style/css'
import 'element-plus/es/components/input/style/css'
Doc mapping (one-to-one with official documentation)
Guide (指南):
Components (组件):
Examples and Templates
This skill includes detailed examples organized to match the official documentation structure. All examples are in the examples/ directory (see mapping above).
To use examples:
- Identify the topic from the user's request
- Load the appropriate example file from the mapping above
- Follow the instructions, syntax, and best practices in that file
- Adapt the code examples to your specific use case
To use templates:
- Reference templates in
templates/ directory for common scaffolding
- Adapt templates to your specific needs and coding style
API Reference
Detailed API documentation is available in the api/ directory, organized to match the official Element Plus API documentation structure:
Component API (api/component-api.md)
- Component props and events
- Component methods
- Component slots
Props and Events (api/props-and-events.md)
- Common props
- Common events
- Event handling
Global Configuration (api/global-config.md)
- Global configuration options
- ConfigProvider usage
- Theme configuration
To use API reference:
- Identify the API you need help with
- Load the corresponding API file from the
api/ directory
- Find the API signature, parameters, return type, and examples
- Reference the linked example files for detailed usage patterns
- All API files include links to relevant example files in the
examples/ directory
Best Practices
- Use on-demand import: Import only the components you need to reduce bundle size
- Use Composition API: Prefer Composition API for better code organization
- Handle events properly: Use proper event handlers for component interactions
- Customize theme: Use theme variables for customization
- Follow design specs: Follow Element Design specifications
- Use TypeScript: Leverage TypeScript for better type safety
Resources
Keywords
Element Plus, element-plus, Vue 3, Vue3, UI components, component library, 组件库, 按钮, 表单, 表格, 弹窗, 消息, 通知, 菜单, 标签页, 日期选择器, 选择器, 开关, 复选框, 单选框, 上传, 分页, 树形控件, 穿梭框, 描述列表, 头像, 徽标, 标签, 空状态, 加载, 弹出框, 提示, 下拉菜单, 抽屉, 气泡确认框, Button, Form, Table, Dialog, Message, Notification, Menu, Tabs, DatePicker, Select, Switch, Checkbox, Radio, Upload, Pagination, Tree, Transfer, Descriptions, Avatar, Badge, Tag, Empty, Loading, Popover, Tooltip, Dropdown, Drawer, Popconfirm
能力边界
✅ 适用场景
- 当你需要使用此技能对应的技术栈时
- 当项目需要遵循最佳实践时
- 当需要快速上手或深入理解核心概念时
⚠️ 需要注意
- 复杂业务逻辑需要结合具体场景调整
- 性能优化需要根据实际数据量评估
❌ 不适用场景
常见陷阱 (Gotchas)
- 版本兼容性:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异
- 配置文件格式:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查
- 环境变量:确保所有必要的环境变量已正确设置,敏感信息不要硬编码
- 依赖冲突:多版本共存时注意依赖冲突,使用 lock 文件锁定版本
- 性能陷阱:大数据量场景下注意性能优化,避免 N+1 查询等常见问题
使用流程
Step 1: 环境准备
确保开发环境已安装必要的依赖和工具。
Step 2: 配置初始化
根据项目需求进行基础配置。
Step 3: 核心功能使用
按照示例代码实现核心功能。
Step 4: 测试验证
运行测试确保功能正常。
Step 5: 部署上线
完成开发后进行部署和监控。
1---2name: element-plus-vue33description: Provides comprehensive guidance for Element Plus Vue 3 component library including installation, components, themes, internationalization, and API reference. Use when the user asks about Element Plus for Vue 3, needs to build Vue 3 applications with Element Plus, or customize component styles.4license: Complete terms in LICENSE.txt5---67## When to use this skill89Use this skill whenever the user wants to:10- Install and set up Element Plus in a Vue 3 project11- Use Element Plus components in Vue 3 applications12- Configure Element Plus (global config, i18n, theme, etc.)13- Use form components (Button, Input, Form, etc.)14- Use data display components (Table, Card, etc.)15- Use feedback components (Message, Notification, Dialog, etc.)16- Use navigation components (Menu, Tabs, etc.)17- Customize component styles and themes18- Handle component events19- Understand Element Plus API and methods20- Troubleshoot Element Plus issues2122## How to use this skill2324This skill is organized to match the Element Plus official documentation structure (https://element-plus.org/zh-CN/, https://element-plus.org/en-US/guide/design, https://element-plus.org/en-US/component/overview). When working with Element Plus:25261. **Identify the topic** from the user's request:27 - Installation/安装 → `examples/guide/installation.md`28 - Quick Start/快速开始 → `examples/guide/quick-start.md`29 - Design/设计 → `examples/guide/design.md`30 - Components/组件 → `examples/components/`31 - API/API 文档 → `api/`32332. **Load the appropriate example file** from the `examples/` directory:3435 **Guide (使用指南)**:36 - `examples/guide/installation.md` - Installation guide37 - `examples/guide/quick-start.md` - Quick start guide38 - `examples/guide/design.md` - Design guidelines39 - `examples/guide/i18n.md` - Internationalization40 - `examples/guide/theme.md` - Theme customization41 - `examples/guide/global-config.md` - Global configuration4243 **Components (组件)**:44 - `examples/components/overview.md` - Components overview45 - `examples/components/button.md` - Button component46 - `examples/components/input.md` - Input component47 - `examples/components/form.md` - Form component48 - `examples/components/table.md` - Table component49 - `examples/components/card.md` - Card component50 - `examples/components/dialog.md` - Dialog component51 - `examples/components/message.md` - Message component52 - `examples/components/notification.md` - Notification component53 - `examples/components/menu.md` - Menu component54 - `examples/components/tabs.md` - Tabs component55 - `examples/components/date-picker.md` - DatePicker component56 - `examples/components/select.md` - Select component57 - `examples/components/switch.md` - Switch component58 - `examples/components/checkbox.md` - Checkbox component59 - `examples/components/radio.md` - Radio component60 - `examples/components/upload.md` - Upload component61 - `examples/components/pagination.md` - Pagination component62 - `examples/components/tree.md` - Tree component63 - `examples/components/tree-select.md` - TreeSelect component64 - `examples/components/transfer.md` - Transfer component65 - `examples/components/descriptions.md` - Descriptions component66 - `examples/components/avatar.md` - Avatar component67 - `examples/components/badge.md` - Badge component68 - `examples/components/tag.md` - Tag component69 - `examples/components/empty.md` - Empty component70 - `examples/components/loading.md` - Loading component71 - `examples/components/popover.md` - Popover component72 - `examples/components/tooltip.md` - Tooltip component73 - `examples/components/dropdown.md` - Dropdown component74 - `examples/components/drawer.md` - Drawer component75 - `examples/components/popconfirm.md` - Popconfirm component76773. **Follow the specific instructions** in that example file for syntax, structure, and best practices7879 **Important Notes**:80 - Element Plus is for Vue 3 only81 - Components use Vue 3 Composition API82 - Examples include both Options API and Composition API83 - Each example file includes key concepts, code examples, and key points84854. **Reference API documentation** in the `api/` directory when needed:86 - `api/component-api.md` - Component API reference87 - `api/props-and-events.md` - Props and events reference88 - `api/global-config.md` - Global configuration API89905. **Use templates** from the `templates/` directory:91 - `templates/installation.md` - Installation templates92 - `templates/component-usage.md` - Component usage templates93 - `templates/project-setup.md` - Project setup templates9495### 1. Understanding Element Plus9697Element Plus is a Vue 3 component library that provides a rich set of UI components following Element Design principles.9899**Key Concepts**:100- **Vue 3 Support**: Built for Vue 3 with Composition API101- **Design System**: Follows Element Design language102- **Rich Components**: 60+ components for various use cases103- **Theme Customization**: Support for theme customization104- **i18n**: Internationalization support105- **TypeScript**: Full TypeScript support106107### 2. Installation108109**Using npm**:110111```bash112npm install element-plus113```114115**Using yarn**:116117```bash118yarn add element-plus119```120121**Using pnpm**:122123```bash124pnpm add element-plus125```126127### 3. Basic Setup128129**Full Import**:130131```javascript132import { createApp } from 'vue'133import ElementPlus from 'element-plus'134import 'element-plus/dist/index.css'135import App from './App.vue'136137const app = createApp(App)138app.use(ElementPlus)139app.mount('#app')140```141142**On-Demand Import**:143144```javascript145import { ElButton, ElInput } from 'element-plus'146import 'element-plus/es/components/button/style/css'147import 'element-plus/es/components/input/style/css'148```149150151### Doc mapping (one-to-one with official documentation)152153**Guide (指南)**:154- See guide files in `examples/guide/` or `examples/getting-started/` → https://element-plus.org/en-US/guide/design155156**Components (组件)**:157- See component files in `examples/components/` → https://element-plus.org/en-US/component/overview158159## Examples and Templates160161This skill includes detailed examples organized to match the official documentation structure. All examples are in the `examples/` directory (see mapping above).162163**To use examples:**164- Identify the topic from the user's request165- Load the appropriate example file from the mapping above166- Follow the instructions, syntax, and best practices in that file167- Adapt the code examples to your specific use case168169**To use templates:**170- Reference templates in `templates/` directory for common scaffolding171- Adapt templates to your specific needs and coding style172173## API Reference174175Detailed API documentation is available in the `api/` directory, organized to match the official Element Plus API documentation structure:176177### Component API (`api/component-api.md`)178- Component props and events179- Component methods180- Component slots181182### Props and Events (`api/props-and-events.md`)183- Common props184- Common events185- Event handling186187### Global Configuration (`api/global-config.md`)188- Global configuration options189- ConfigProvider usage190- Theme configuration191192**To use API reference:**1931. Identify the API you need help with1942. Load the corresponding API file from the `api/` directory1953. Find the API signature, parameters, return type, and examples1964. Reference the linked example files for detailed usage patterns1975. All API files include links to relevant example files in the `examples/` directory198199## Best Practices2002011. **Use on-demand import**: Import only the components you need to reduce bundle size2022. **Use Composition API**: Prefer Composition API for better code organization2033. **Handle events properly**: Use proper event handlers for component interactions2044. **Customize theme**: Use theme variables for customization2055. **Follow design specs**: Follow Element Design specifications2066. **Use TypeScript**: Leverage TypeScript for better type safety207208## Resources209210- **Official Documentation**: https://element-plus.org/zh-CN/211- **English Documentation**: https://element-plus.org/en-US/212- **Design Guide**: https://element-plus.org/en-US/guide/design213- **Component Overview**: https://element-plus.org/en-US/component/overview214- **GitHub Repository**: https://github.com/element-plus/element-plus215216## Keywords217218Element Plus, element-plus, Vue 3, Vue3, UI components, component library, 组件库, 按钮, 表单, 表格, 弹窗, 消息, 通知, 菜单, 标签页, 日期选择器, 选择器, 开关, 复选框, 单选框, 上传, 分页, 树形控件, 穿梭框, 描述列表, 头像, 徽标, 标签, 空状态, 加载, 弹出框, 提示, 下拉菜单, 抽屉, 气泡确认框, Button, Form, Table, Dialog, Message, Notification, Menu, Tabs, DatePicker, Select, Switch, Checkbox, Radio, Upload, Pagination, Tree, Transfer, Descriptions, Avatar, Badge, Tag, Empty, Loading, Popover, Tooltip, Dropdown, Drawer, Popconfirm219220## 能力边界221222### ✅ 适用场景223- 当你需要使用此技能对应的技术栈时224- 当项目需要遵循最佳实践时225- 当需要快速上手或深入理解核心概念时226227### ⚠️ 需要注意228- 复杂业务逻辑需要结合具体场景调整229- 性能优化需要根据实际数据量评估230231### ❌ 不适用场景232- 不相关的技术栈或框架233- 需要完全自定义的特殊场景234235## 常见陷阱 (Gotchas)2362371. **版本兼容性**:注意框架版本与依赖库的兼容性,不同版本 API 可能有差异2382. **配置文件格式**:配置文件格式错误是最常见的问题,建议使用编辑器的语法检查2393. **环境变量**:确保所有必要的环境变量已正确设置,敏感信息不要硬编码2404. **依赖冲突**:多版本共存时注意依赖冲突,使用 lock 文件锁定版本2415. **性能陷阱**:大数据量场景下注意性能优化,避免 N+1 查询等常见问题242243## 使用流程244245### Step 1: 环境准备246确保开发环境已安装必要的依赖和工具。247248### Step 2: 配置初始化249根据项目需求进行基础配置。250251### Step 3: 核心功能使用252按照示例代码实现核心功能。253254### Step 4: 测试验证255运行测试确保功能正常。256257### Step 5: 部署上线258完成开发后进行部署和监控。