### Basic TimeSelect Setup Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/time-select.md Configure el-time-select with start, end, and step times to provide a list of fixed time options for users. ```vue ``` -------------------------------- ### Install Dependencies Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/guide/dev-guide.md Installs all project dependencies using pnpm. Ensure you have pnpm installed globally. ```shell pnpm i ``` -------------------------------- ### Basic Container Example Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/container.md A fundamental example showcasing the usage of the el-container component. ```html Header Main ``` -------------------------------- ### Start Local Development Environment Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/guide/dev-guide.md Starts the local development server for real-time development and testing of components. ```shell pnpm dev ``` -------------------------------- ### Install Element Plus Source: https://github.com/liuzhong0117/element-plus/blob/dev/packages/theme-chalk/README.md Install the element-plus package using npm. ```shell npm i element-plus ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/liuzhong0117/element-plus/blob/dev/CONTRIBUTING.md Installs the necessary dependencies for the Element Plus project. Ensure you have Node.js and pnpm installed. ```shell cd $THE_PROJECT_PATH_YOU_DOWNLOADED # If you haven't installed yet pnpm install ``` -------------------------------- ### Page Header Complete Example Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/page-header.md A comprehensive example demonstrating the full capabilities of the Page Header component. ```vue ``` -------------------------------- ### Install Auto Import Plugins Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/guide/quickstart.md Install necessary packages for on-demand component and function auto-importing. ```shell npm install -D unplugin-vue-components unplugin-auto-import ``` -------------------------------- ### Verify Installation Source: https://github.com/liuzhong0117/element-plus/blob/dev/CONTRIBUTING.md Runs tests and checks code formatting to verify that the project has been set up correctly. These commands ensure your environment is ready for development. ```shell pnpm t pnpm format ``` -------------------------------- ### Install Nuxt Module Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/guide/quickstart.md Install the official Element Plus Nuxt module for seamless integration. ```shell npm install -D @element-plus/nuxt ``` -------------------------------- ### Install @element-plus/icons-vue Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/icon.md Install the Element Plus Icons Vue package using npm, yarn, or pnpm. ```shell # Choose a package manager you like. # NPM $ npm install @element-plus/icons-vue # Yarn $ yarn add @element-plus/icons-vue # pnpm $ pnpm install @element-plus/icons-vue ``` -------------------------------- ### Install Element Plus with Package Managers Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/guide/installation.md Use npm, yarn, or pnpm to install Element Plus. This is the recommended method for use with bundlers like Vite or webpack. ```shell # NPM $ npm install element-plus --save ``` ```shell # Yarn $ yarn add element-plus ``` ```shell # pnpm $ pnpm install element-plus ``` -------------------------------- ### Image Preview Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/image.md Enable image preview by providing an array of image URLs to the `preview-src-list` prop. The `initial-index` prop can set the starting preview image. ```html ``` -------------------------------- ### Manual Component Import Example Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/guide/quickstart.md Demonstrates manually importing a single component and its styles within a Vue component. Requires unplugin-element-plus for style imports. ```html ``` -------------------------------- ### Full Import in main.ts Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/guide/quickstart.md Use this for a straightforward setup where bundle size is not a primary concern. It imports all Element Plus components and styles. ```typescript 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') ``` -------------------------------- ### Import and Use Element Plus Source: https://github.com/liuzhong0117/element-plus/blob/dev/packages/element-plus/README.md Demonstrates how to import and use the Element Plus library in a Node.js environment. This is a basic setup for integrating Element Plus. ```javascript const elementPlus = require('element-plus'); // TODO: DEMONSTRATE API ``` -------------------------------- ### Run Local Component Playground Source: https://github.com/liuzhong0117/element-plus/blob/dev/CONTRIBUTING.md Starts a local playground environment to test changes made to specific components. This is useful for isolated component development. ```shell # If you would like to run a local playground to test out your changes against # Some specific component pnpm dev ``` -------------------------------- ### Basic Virtualized Table Usage Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/table-v2.md Demonstrates the performance of the Virtualized Table by rendering a basic example with 10 columns and 1000 rows. Ensure the component is wrapped in `` for SSR/SSG environments. ```vue ``` -------------------------------- ### Alert with Icon and Description Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/alert.md An example combining both an icon and a detailed description within the Alert component for enhanced clarity. ```vue ``` -------------------------------- ### Pagination with More Elements and Event Handling Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/pagination.md A comprehensive example demonstrating various pagination elements and handling page size and current page changes using `size-change` and `current-change` events. The `page-sizes` attribute configures the options for the page size selector. ```html ``` -------------------------------- ### Example of Element Plus Component Usage Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/guide/installation.md Demonstrates the basic structure for using Element Plus components like el-table within an HTML template. Ensure to use double-closed tags for compatibility. ```html ``` -------------------------------- ### Top Navigation Example Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/guide/nav.md Component for top navigation. Suitable for sites with few navigation items and large content chunks, conforming to a natural top-to-bottom browsing order. ```vue ``` -------------------------------- ### Check Tree Nodes Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/tree.md Demonstrates how to get and set checked nodes using either the node or key approach. The `node-key` prop is required when using the key approach. ```vue ``` -------------------------------- ### On-demand Import of Transitions Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/guide/transitions.md Import transition components and styles on demand for better bundle size management. This example shows how to import `ElCollapseTransition` and base CSS for fade/zoom effects. ```typescript // collapse import { ElCollapseTransition } from 'element-plus' // fade/zoom import 'element-plus/lib/theme-chalk/base.css' import App from './App.vue' const app = createApp(App) app.component(ElCollapseTransition.name, ElCollapseTransition) ``` -------------------------------- ### Multi-select with Virtualized Select Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/select-v2.md Enables selecting multiple options in the virtualized select component. This example shows the basic setup for multi-selection. ```vue ``` -------------------------------- ### Preview Website Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/guide/dev-guide.md Launches the project's website for previewing components. This command is useful for checking the appearance and behavior of existing components. ```shell pnpm docs:dev ``` -------------------------------- ### Using ElLoading Service Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/loading.md Import and invoke the `ElLoading.service` method with configuration options. The method returns a loading instance that can be closed using its `close` method. Note that full-screen loading is a singleton. ```APIDOC ## Service Import Loading service: ```ts import { ElLoading } from 'element-plus' ``` Invoke it: ```ts const loadingInstance = ElLoading.service(options) nextTick(() => { loadingInstance.close() }) ``` ### Parameters `options` is the configuration object for the Loading service. Refer to the table below for details. ### Return Value `ElLoading.service(options)` returns a Loading instance. ### Instance Methods - `close()`: Closes the loading indicator. ### Singleton Behavior For full-screen loading (`fullscreen: true`), the service acts as a singleton. Invoking `ElLoading.service({ fullscreen: true })` multiple times before closing will return the same instance. ```ts const loadingInstance1 = ElLoading.service({ fullscreen: true }) const loadingInstance2 = ElLoading.service({ fullscreen: true }) console.log(loadingInstance1 === loadingInstance2) // true ``` Calling `close()` on any instance will close the full-screen loading. ## Global Property $loading If Element Plus is imported entirely, a global method `$loading` is registered to `app.config.globalProperties`. It can be invoked using `this.$loading(options)` and also returns a Loading instance. ``` -------------------------------- ### Tour Placement Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/tour.md Demonstrates changing the placement of the guide relative to the target element. Supports 12 placements. When `target` is empty, the guide shows in the center. ```vue ``` -------------------------------- ### Card Style Tabs Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/tabs.md Set `type` to `card` to get a card-styled tab. ```html ``` -------------------------------- ### Hybrid Layout Example Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/layout.md Combine different column spans to create more complex hybrid layouts. ```vue
``` -------------------------------- ### Basic Usage of Descriptions Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/descriptions.md Demonstrates the fundamental implementation of the Descriptions component to display key-value pairs. ```vue ``` -------------------------------- ### Column Offset Example Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/layout.md Use the `offset` attribute on `el-col` to create horizontal space before a column, effectively offsetting it. ```vue
``` -------------------------------- ### Simple Card Without Header Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/card.md A simple card example where the header section is omitted, focusing only on the body content. ```vue ``` -------------------------------- ### Enable Inline Editing in Table Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/table-v2.md Allows users to edit table data directly within cells, similar to the selection example. ```vue ``` -------------------------------- ### Basic Usage of Virtualized Select Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/select-v2.md Demonstrates the fundamental implementation of the virtualized select component. Ensure the component is wrapped in `` when used in SSR or SSG environments. ```vue ``` -------------------------------- ### Accessible Tooltip Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/tooltip-v2.md Shows how to implement an accessible tooltip, ensuring usability for users with disabilities. This example focuses on ARIA attributes and keyboard navigation. ```vue ``` -------------------------------- ### Drawer Basic Usage Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/drawer.md Demonstrates how to use the Drawer component with default settings. Control visibility using `model-value`. Customize direction and size as needed. ```vue ``` -------------------------------- ### Add and Close Tabs Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/tabs.md Only card type Tabs support adding and closing tabs dynamically. This example demonstrates how to manage tabs programmatically. ```html ``` -------------------------------- ### Basic Steps Configuration Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/steps.md Configure the active step using the `active` attribute (0-indexed). Set a fixed width for steps with the `space` attribute (in px), or leave it responsive. Customize the status of completed steps using `finish-status`. ```vue ``` -------------------------------- ### Steps with Status Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/steps.md Set step titles using the `title` attribute or by overriding with a named slot. This example demonstrates how to display the status for each step. ```vue ``` -------------------------------- ### Draggable Dialog Example Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/dialog.md Set `draggable` to `true` to enable dragging. The `overflow` attribute (version 2.5.4+) allows dragging outside the viewport. ```vue ``` -------------------------------- ### Import Theme with Sass Source: https://github.com/liuzhong0117/element-plus/blob/dev/packages/theme-chalk/README.md Import the chalk theme using Sass. ```css @use 'element-plus/lib/theme-chalk/index.scss'; ``` -------------------------------- ### Nested Drawer Example Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/drawer.md Shows how to implement multiple layers of Drawer components. For nested drawers, it is mandatory to set the `append-to-body` attribute to `true`. ```vue ``` -------------------------------- ### Basic Affix Usage Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/affix.md Demonstrates the basic usage of the Affix component, which is fixed at the top of the page by default. ```vue ``` -------------------------------- ### Form Accessibility Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/form.md When a `el-form-item` contains multiple inputs, it gets the WAI-ARIA role of `group`. Ensure individual inputs have assistive labels assigned. ```vue ``` -------------------------------- ### File List with Thumbnail Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/upload.md Demonstrates how to display uploaded files with thumbnails in a list format. ```vue ``` -------------------------------- ### Basic Tree Usage Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/tree.md Demonstrates the fundamental structure of a tree component. ```vue ``` -------------------------------- ### Level 2 Categories Example Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/guide/nav.md Component for displaying level 2 navigation categories. Recommended for use with breadcrumbs to aid user location and navigation. ```vue ``` -------------------------------- ### Level 1 Categories Example Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/guide/nav.md Component for displaying level 1 navigation categories. Suitable for simply structured sites with only one level of pages. ```vue ``` -------------------------------- ### Basic Tour Usage Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/tour.md Demonstrates the most basic implementation of the Tour component. ```vue ``` -------------------------------- ### Provide Button Configurations Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/config-provider.md Configure global settings for buttons, such as size and auto-insert-space. ```vue ``` -------------------------------- ### Basic Skeleton Usage Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/skeleton.md Demonstrates the fundamental usage of the Skeleton component. This is the simplest way to implement a skeleton screen. ```vue ``` -------------------------------- ### Switch Sizes Source: https://github.com/liuzhong0117/element-plus/blob/dev/docs/en-US/component/switch.md Demonstrates different size options for the Switch component. ```html ```