### Install Dependencies
Source: https://element-plus.org/zh-CN/guide/dev-guide
Run this command to install all necessary project dependencies before starting development.
```shell
pnpm i
```
--------------------------------
### Tree Node Selection Example
Source: https://element-plus.org/zh-CN/component/tree
This example shows how to get and set selected nodes in a tree. It includes methods for getting nodes/keys and setting nodes/keys, as well as a reset function. Ensure `node-key` is set for key-based operations.
```vue
get by nodeget by keyset by nodeset by keyreset
```
--------------------------------
### Table Configuration Example
Source: https://element-plus.org/zh-CN/component/config-provider
Example of using ConfigProvider to configure table overflow tooltip behavior.
```APIDOC
## Table Configuration Example (2.13.3)
### Description
This example demonstrates how to use `el-config-provider` to configure the `showOverflowTooltip` and `tooltipEffect` for `el-table` components.
### Usage
Wrap your `el-table` with `el-config-provider` and pass the `table` configuration object.
### Configuration Options
- **showOverflowTooltip** (boolean): Controls whether to display tooltips for overflowing content in table cells. (Available since 2.13.3)
- **tooltipEffect** (string): Sets the effect of the tooltip ('dark' or 'light'). (Available since 2.13.3)
### Code Example
```vue
showOverflowTooltip
{{ scope.row.date }}
```
```
--------------------------------
### Basic Timeline Example
Source: https://element-plus.org/zh-CN/component/timeline
A simple example demonstrating the basic usage of the ElTimeline component with ElTimelineItem.
```APIDOC
## Basic Timeline Example
This example shows how to use the `el-timeline` and `el-el-timeline-item` components to display a series of events with timestamps and descriptions.
### Component Usage
```vue
Update Github template
Tom committed 2018/4/12 20:46
Update Github template
Tom committed 2018/4/3 20:46
Event start
Event end
```
```
--------------------------------
### Install @element-plus/icons-vue with npm
Source: https://element-plus.org/zh-CN/component/icon
Use npm to install the Element Plus icons package.
```shell
$ npm install @element-plus/icons-vue
```
--------------------------------
### Install @element-plus/icons-vue with pnpm
Source: https://element-plus.org/zh-CN/component/icon
Use pnpm to install the Element Plus icons package.
```shell
$ pnpm install @element-plus/icons-vue
```
--------------------------------
### Add Tab Example
Source: https://element-plus.org/zh-CN/component/tabs
Example of how to add a tab dynamically using the `addTab` function.
```APIDOC
## 增加标签页触发器自定义
add tab
Tab 1 __
Tab 2 __
Tab 1 content
Tab 2 content
```vue
add tab
{{ item.content }}
```
```
--------------------------------
### Custom Cell Renderer Example
Source: https://element-plus.org/zh-CN/component/table-v2
Demonstrates how to use a custom cell renderer for a table column. This example shows a basic setup for a table with generated columns and data.
```vue
```
--------------------------------
### Customized Style List Example
Source: https://element-plus.org/zh-CN/component/descriptions
Example of using the ElDescriptions component with custom styling for labels and content.
```APIDOC
## Customized style list
This example demonstrates how to customize the appearance of the Descriptions component using scoped CSS.
### Component Usage
```vue
kooriookami
18100000000
Suzhou
School
No.1188, Wuzhong Avenue, Wuzhong District, Suzhou, Jiangsu Province
```
### CSS Styling
Custom classes `my-label` and `my-content` are applied to `el-descriptions-item` to control background colors.
```
--------------------------------
### Install @element-plus/icons-vue with yarn
Source: https://element-plus.org/zh-CN/component/icon
Use yarn to install the Element Plus icons package.
```shell
$ yarn add @element-plus/icons-vue
```
--------------------------------
### Lazy Loading Example
Source: https://element-plus.org/zh-CN/component/splitter
Example demonstrating the lazy loading feature of the Splitter component, where panel sizes update only after dragging ends.
```APIDOC
## 延迟2.11.0
当启用`lazy`时,面板大小将不会在拖动时实时更新,只能在拖动结束后更新。
```vue
1
2
3
```
```
--------------------------------
### Complete Page Header Example
Source: https://element-plus.org/zh-CN/component/page-header.html
A comprehensive example demonstrating the full capabilities of the page header component, including breadcrumbs, content, extra actions, and descriptions. Use when a detailed header is required.
```vue
Element Plus team uses weekly release strategy under normal
circumstance, but critical bug fixes would require hotfix so the actual
release number could be more than 1 per week.
```
--------------------------------
### Install Auto-Import and Components Plugins
Source: https://element-plus.org/zh-CN/guide/quickstart
Install `unplugin-vue-components` and `unplugin-auto-import` for on-demand component import. Use npm, yarn, or pnpm.
```shell
$ npm install -D unplugin-vue-components unplugin-auto-import
```
```shell
$ yarn add -D unplugin-vue-components unplugin-auto-import
```
```shell
$ pnpm install -D unplugin-vue-components unplugin-auto-import
```
--------------------------------
### Default Value Example
Source: https://element-plus.org/zh-CN/component/tabs
Example demonstrating the use of `default-value` to set the initially active tab.
```APIDOC
## 默认值2.11.9
```vue
default-value: third
active: {{ activeName }}
```
```
--------------------------------
### Basic Timeline Example
Source: https://element-plus.org/zh-CN/component/timeline
A simple timeline displaying events with cards. Each item includes a timestamp and content.
```vue
Update Github template
Tom committed 2018/4/12 20:46
Update Github template
Tom committed 2018/4/3 20:46
Event start
Event end
```
--------------------------------
### Basic Table V2 Usage
Source: https://element-plus.org/zh-CN/component/table-v2
Demonstrates the fundamental setup for the Table V2 component, including generating columns and data. Ensure you have the necessary script setup.
```vue
```
--------------------------------
### Install Nuxt Module for Element Plus
Source: https://element-plus.org/zh-CN/guide/quickstart
Install the `@element-plus/nuxt` package for seamless integration with Nuxt.js. Use npm, yarn, or pnpm.
```shell
$ npm install -D @element-plus/nuxt
```
```shell
$ yarn add -D @element-plus/nuxt
```
```shell
$ pnpm install -D @element-plus/nuxt
```
--------------------------------
### Preview Website Locally
Source: https://element-plus.org/zh-CN/guide/dev-guide
Use this command to start the documentation website locally. You can then preview all existing components within the site.
```shell
pnpm docs:dev
```
--------------------------------
### Hello World with Element Plus via CDN
Source: https://element-plus.org/zh-CN/guide/installation
A basic 'Hello World' example demonstrating how to use Element Plus with Vue.js when included via CDN. It shows how to mount an app and use the ElButton component.
```html
Element Plus demo
{{ message }}
```
--------------------------------
### Row Alignment Examples
Source: https://element-plus.org/zh-CN/component/layout
Demonstrates different horizontal alignment options for columns within an ElRow component using the 'justify' attribute. Available options include start, center, end, space-between, space-around, and space-evenly.
```vue
```
--------------------------------
### Start Local Development Environment
Source: https://element-plus.org/zh-CN/guide/dev-guide
This command launches the local development environment for the project. Ensure your custom component is registered in @element-plus/components.
```shell
pnpm dev
```
--------------------------------
### Year Range Picker with and without Linked Panels
Source: https://element-plus.org/zh-CN/component/date-picker
Demonstrates how to use the year range picker. The `unlink-panels` attribute can be used to disable the linkage between the start and end year panels. Includes examples with and without quick options.
```vue
Default
With quick options
```
--------------------------------
### Managing Splitter Panel Size with v-model
Source: https://element-plus.org/zh-CN/component/splitter
Utilizes `v-model:size` to get and set the size of an ElSplitterPanel. Includes event handlers for resize start, end, and during the resize operation. Sets `max` and `min` constraints for the resizable panel.
```vue
1
{{ size }}px
3
```
--------------------------------
### Open Event Dialog Example
Source: https://element-plus.org/zh-CN/component/dialog
Demonstrates how to open a dialog and log various lifecycle events. Use the browser's developer console to observe the event order.
```vue
Open the event Dialog
It's a event Dialog
```
--------------------------------
### Prevent Collapse Example
Source: https://element-plus.org/zh-CN/component/collapse
Example demonstrating how to prevent collapse using the `beforeChange` attribute.
```APIDOC
## 阻止折叠 2.9.11
设置 `beforeChange` 属性,若返回 false 或者返回 `Promise` 且被 `reject` ,则停止切换。
### Request Example
```vue
before collapse return:
Consistent with real life: in line with the process and logic of real
life, and comply with languages and habits that the users are used to;
Consistent within interface: all elements should be consistent, such
as: design style, icons and texts, position of elements, etc.
Operation feedback: enable the users to clearly perceive their
operations by style updates and interactive effects;
Visual feedback: reflect current state by updating or rearranging
elements of the page.
Simplify the process: keep operating process simple and intuitive;
Definite and clear: enunciate your intentions clearly so that the
users can quickly understand and make decisions;
Easy to identify: the interface should be straightforward, which helps
the users to identify and frees them from memorizing and recalling.
Decision making: giving advices about operations is acceptable, but do
not make decisions for the users;
Controlled consequences: users should be granted the freedom to
operate, including canceling, aborting or terminating current
operation.
```
```
--------------------------------
### Basic Usage
Source: https://element-plus.org/zh-CN/component/empty
Demonstrates the basic usage of the ElEmpty component with a default description.
```APIDOC
## POST /api/users
### Description
Creates a new user in the system.
### Method
POST
### Endpoint
/api/users
### Parameters
#### Request Body
- **username** (string) - Required - The username for the new user.
- **email** (string) - Required - The email address for the new user.
- **password** (string) - Required - The password for the new user.
### Request Example
```json
{
"username": "johndoe",
"email": "john.doe@example.com",
"password": "securepassword123"
}
```
### Response
#### Success Response (201)
- **id** (string) - The unique identifier for the newly created user.
- **username** (string) - The username of the created user.
- **email** (string) - The email address of the created user.
#### Response Example
```json
{
"id": "user-12345",
"username": "johndoe",
"email": "john.doe@example.com"
}
```
```
--------------------------------
### Steps with Descriptions
Source: https://element-plus.org/zh-CN/component/steps
Each step can include a description.
```APIDOC
## Steps with Descriptions
Each step has a description.
### Method
N/A (Component Usage)
### Endpoint
N/A (Component Usage)
### Parameters
#### Component Properties
- **active** (number) - Required - The index of the current active step, starting from 0.
### Request Example
```vue
```
```
--------------------------------
### Basic Usage of Virtualized Table
Source: https://element-plus.org/zh-CN/component/table-v2
This snippet demonstrates the basic setup for a virtualized table with 10 columns and 200 rows. It utilizes helper functions to generate columns and data dynamically. Ensure you have the `el-table-v2` component imported and configured.
```vue
```
--------------------------------
### Vue Tour with Various Target Configurations
Source: https://element-plus.org/zh-CN/component/tour
Shows how to configure tour step targets using element refs, query selectors, and function callbacks. Requires Vue and Element Plus.
```vue
Begin TourUploadSave
```