### 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 ``` -------------------------------- ### 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 ``` ``` -------------------------------- ### 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 ``` ``` -------------------------------- ### 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 ``` ``` -------------------------------- ### 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 ``` ### 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 ``` ``` -------------------------------- ### 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 ``` -------------------------------- ### 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 ``` ``` -------------------------------- ### 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 ``` -------------------------------- ### 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 ``` -------------------------------- ### 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 ``` -------------------------------- ### 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 ``` -------------------------------- ### 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 ``` ``` -------------------------------- ### 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 ```