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:
```bash
npm install element-plus
```
Using yarn:
```bash
yarn add element-plus
```
Using pnpm:
```bash
pnpm add element-plus
```
3. Basic Setup
Full Import:
```javascript
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:
```javascript
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 (指南):
- See guide files in
examples/guide/ or examples/getting-started/ → https://element-plus.org/en-US/guide/design
Components (组件):
- See component files in
examples/components/ → https://element-plus.org/en-US/component/overview