### Basic Tree Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/tree/TEMPLATE.md
Demonstrates the fundamental usage of the Tree component with basic data. No specific setup is required beyond importing the component.
```vue
```
--------------------------------
### Start Development Server
Source: https://github.com/arco-design/arco-design-vue/blob/main/CONTRIBUTING.zh-CN.md
Start the development server to preview the site.
```bash
pnpm run start
```
--------------------------------
### Basic Transfer Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/transfer/__demo__/basic.md
This snippet shows the fundamental setup for the Transfer component. It includes defining the data source and the initial selected values.
```vue
```
--------------------------------
### Start Vite Server for Development
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-scripts/README.md
Use `dev:site` to start the Vite server for site development.
```bash
arco-vue-scripts dev:site
```
--------------------------------
### Start Development Server
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-docs/docs/pro/start.en-US.md
Navigate into the newly created project directory and start the development server. Open your browser to localhost:3000 to view the application.
```bash
cd hello-arco-pro
npm run dev
```
--------------------------------
### Install Dependencies
Source: https://github.com/arco-design/arco-design-vue/blob/main/CONTRIBUTING.zh-CN.md
Install all project dependencies using pnpm.
```bash
pnpm install
```
--------------------------------
### Import and Configure Store
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-docs/docs/pro/state-management.zh-CN.md
Create the Vuex store by importing necessary modules and defining the root state and store types. This example demonstrates the basic setup for creating a typed Vuex store.
```typescript
// store/index.ts
//此处示例,只保留关键语句。具体参见pro项目。
import {
createStore,
useStore as VuexUseStore,
Store as VuexStore,
} from 'vuex';
import { RootState, UserStateTypes } from './interface';
import { UserStoreModuleTypes } from './modules/interface';
import modules from './modules/index';
export type StoreModules = {
user: UserStoreModuleTypes;
};
export interface StateModuler {
user: UserStateTypes;
}
export type Store = UserStoreModuleTypes>
```
--------------------------------
### Install Dependencies
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-docs/README.md
Run this command to install project dependencies using Yarn or npm.
```bash
yarn # or npm install
```
--------------------------------
### Start Local Development
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-docs/README.md
Execute this command to start the local development environment for Arco Design Vue.
```bash
npm run start
```
--------------------------------
### Start Storybook
Source: https://github.com/arco-design/arco-design-vue/blob/main/CONTRIBUTING.zh-CN.md
Start Storybook for component debugging. This is optional as components can also be debugged on the official website.
```bash
pnpm run storybook
```
--------------------------------
### Basic Calendar Usage
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/calendar/TEMPLATE.md
Demonstrates the basic setup and rendering of the Calendar component.
```vue
```
--------------------------------
### Install Arco CLI
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-docs/docs/pro/start.en-US.md
Install the Arco CLI globally to manage project templates. This is a prerequisite for initializing a new project.
```bash
npm i -g arco-cli
```
--------------------------------
### Run Storybook
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue-storybook/README.md
Execute this command in your terminal to start the Storybook development server.
```bash
npm run storybook
```
--------------------------------
### Vue Basic Input Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/input/__demo__/basic.md
Shows how to use the A-Input component for basic text input with placeholders and clear functionality. Includes examples for both uncontrolled and controlled input states.
```vue
```
--------------------------------
### Drawer Placement Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/drawer/__demo__/position.md
Control the drawer's sliding direction using the 'placement' prop. This example allows users to select 'top', 'right', 'bottom', or 'left' via radio buttons.
```vue
TopRightBottomLeft
Open Drawer
Title
You can customize modal body text by the current situation. This modal
will be closed immediately once you press the OK button.
```
--------------------------------
### Basic Carousel Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/carousel/TEMPLATE.md
Demonstrates the fundamental usage of the Carousel component. Ensure you have the necessary imports for the Carousel and its items.
```vue
1
2
3
4
```
--------------------------------
### Initialize Project
Source: https://github.com/arco-design/arco-design-vue/blob/main/CONTRIBUTING.zh-CN.md
Initialize the project workspaces.
```bash
pnpm run init
```
--------------------------------
### One Way Transfer Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/transfer/__demo__/one-way.md
Demonstrates a basic one-way transfer component setup. Use this when data only needs to move from one list to another without a return path.
```vue
```
--------------------------------
### Small Steps Component
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/steps/__demo__/small.md
Use the `small` prop to render the steps component in a compact size. This example shows a basic setup with three steps, highlighting the 'Processing' step.
```vue
SucceededProcessingPending
Step 2 Content
```
--------------------------------
### Basic Carousel Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/carousel/__demo__/basic.md
A standard carousel with a fixed size, a default starting slide, and an event handler for slide changes. This is useful for displaying a series of images or content in a rotating manner.
```vue
```
--------------------------------
### Build Document Site
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-scripts/README.md
Use `build:site` to build the documentation site.
```bash
arco-vue-scripts build:site
```
--------------------------------
### Select Technology Stack Prompt
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-docs/docs/pro/start.en-US.md
This is an example of the interactive prompt for selecting the technology stack during project initialization. Use arrow keys to navigate and Enter to select.
```bash
? Please select the technology stack you wish to use
React
❯ Vue
```
--------------------------------
### Space Component Alignment Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/space/__demo__/align.md
Demonstrates how to use the `align` prop of the Space component to control the alignment of its children. It includes a radio group to dynamically change the alignment between 'start', 'center', 'end', and 'baseline'.
```vue
startcenterendbaseline
Space:Item2 Card content
```
--------------------------------
### Vuex Store Setup
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-docs/docs/pro/state-management.en-US.md
Sets up the Vuex store by creating it and importing necessary types and modules. This file defines the root state and module interfaces.
```typescript
// store/index.ts
//In the example here, only key statements are kept. See the pro project for details.
import {
createStore,
useStore as VuexUseStore,
Store as VuexStore,
} from'vuex';
import {RootState, UserStateTypes} from'./interface';
import {UserStoreModuleTypes} from'./modules/interface';
import modules from'./modules/index';
export type StoreModules = {
user: UserStoreModuleTypes;
};
export interface StateModuler {
user: UserStateTypes;
}
export type Store = UserStoreModuleTypes>
```
--------------------------------
### Basic Affix Usage
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/affix/README.en-US.md
Demonstrates the basic implementation of the Affix component. No specific setup is required beyond importing the component.
```vue
Affix top
```
--------------------------------
### Vue Virtual List Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/list/__demo__/virtual-list.md
Demonstrates how to enable and configure a virtual list for rendering 10,000 items in a Vue.js application using Arco Design Vue. It shows the setup for `virtualListProps` to manage performance with large datasets.
```vue
10000 items
A
```
--------------------------------
### Use User Store in a Vue Component
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-docs/docs/pro/state-management-pinia.en-US.md
Import and utilize the user store within a Vue component's setup function. This example demonstrates how to access store actions like login, which requires an asynchronous call.
```typescript
import { defineComponent } from 'vue';
import { useUserStore } from '@/store';
export default defineComponent({
setup() {
const userStore = useUserStore();
const login = () => {
const userInfo ={
username: 'admin',
password: 'admin',
};
await userStore.login(userInfo);
}
return {
login,
}
}
})
```
--------------------------------
### Run Local Development Server
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-docs/docs/pro/npm-scripts.en-US.md
Use this command to start the local development server. It utilizes Vite with a specific development configuration file.
```bash
npm run dev
```
```json
{
"scripts": {
"dev": "vite --config ./config/vite.config.dev.ts"
}
}
```
--------------------------------
### Carousel with Customizable Indicator
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/carousel/__demo__/indicator.md
This example shows how to use radio groups to dynamically change the indicator type (dot, line, slider) and position (left, right, top, bottom, outer) of a carousel component. It includes basic setup for images and event handlers.
```vue
dotlinesliderleftrighttopbottomouter
```
--------------------------------
### Run Build Command
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-docs/docs/pro/build.en-US.md
Execute this command to package the project. After completion, a 'dist' folder containing deployable code will be generated.
```bash
npm run build
```
--------------------------------
### Install Arco Changelog
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-changelog/README.md
Install the changelog generator using npm.
```bash
npm install @arco-design/arco-changelog
```
--------------------------------
### Vuex Project Structure Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-docs/docs/pro/state-management.en-US.md
Illustrates a common directory structure for organizing Vuex modules, including state, mutations, actions, getters, and type definitions.
```tree
├── modulers
│ ├── user (specific module, subject to actual project)
│ │ └── action-types.ts (action enumeration type)
│ │ └── actions.ts (action implementation)
│ │ └── getters.ts (specific implementation of getter)
│ │ └── index.ts (module entry)
│ │ └── mutations-types.ts (mutation enumeration type)
│ │ └── mutations.ts (specific implementation of mutations)
│ │ └── state.ts (state definition)
│ │ └── types.ts (Summary of module types)
│ ├── interface.ts (Summary of export modules)
├── index.ts (used to export store)
├── interface.ts (the definition of root)
├── vuex.d.ts (Declare Vue's custom type)
```
--------------------------------
### Initialize Arco Design Pro Project
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-docs/docs/pro/start.en-US.md
Create a new Arco Design Pro project named 'hello-arco-pro' in the current directory. Follow the prompts to select the technology stack and project category.
```bash
cd someDir
arco init hello-arco-pro
```
--------------------------------
### Install Arco Design Vue
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/README.md
Install the Arco Design Vue package using npm or yarn.
```bash
// with npm
npm install @arco-design/web-vue
// with yarn
yarn add @arco-design/web-vue
```
--------------------------------
### Build Production Component Files
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-scripts/README.md
Use `build:component` to build production-ready component files.
```bash
arco-vue-scripts build:component
```
--------------------------------
### Basic Drawer Usage
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/drawer/TEMPLATE.md
Demonstrates the fundamental implementation of the Drawer component. No specific setup is required beyond importing the component.
```vue
Open Drawer
Drawer content...
```
--------------------------------
### Install Arco Vue Scripts
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-scripts/README.md
Install the Arco Design Vue scripts package using npm.
```bash
npm install @arco-design/arco-vue-scripts
```
--------------------------------
### Vue Basic Steps Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/steps/__demo__/basic.md
Demonstrates the basic usage of the a-steps and a-step components in Vue.js. Sets the current active step and displays content associated with each step.
```vue
SucceededProcessingPending
Step 2 Content
```
--------------------------------
### Install Arco Design Vue
Source: https://github.com/arco-design/arco-design-vue/blob/main/README.md
Install the Arco Design Vue package using npm, yarn, or pnpm.
```bash
npm install @arco-design/web-vue
```
```bash
yarn add @arco-design/web-vue
```
```bash
pnpm add @arco-design/web-vue
```
--------------------------------
### Comment Alignment Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/comment/__demo__/align.md
Sets the alignment of the datetime and actions for the comment component. This example shows right alignment.
```vue
{{ 83 + (like ? 1 : 0) }}
{{ 3 + (star ? 1 : 0) }}
Reply
A design is a plan or specification for the construction of an object or
system or for the implementation of an activity or process, or the
result of that plan or specification in the form of a prototype, product
or process.
```
--------------------------------
### Install Arco Design Vue
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-docs/docs/start.en-US.md
Use npm or yarn to install the Arco Design Vue package as a development dependency.
```shell
# npm
npm install --save-dev @arco-design/web-vue
# yarn
yarn add --dev @arco-design/web-vue
```
--------------------------------
### Basic Skeleton Usage
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/skeleton/TEMPLATE.md
Demonstrates the basic implementation of the Skeleton component. No specific setup is required beyond importing the component.
```vue
```
--------------------------------
### Basic ResizeBox Usage
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/resize-box/TEMPLATE.md
Demonstrates the basic functionality of the ResizeBox component. No specific setup is required beyond importing the component.
```vue
Content
```
--------------------------------
### All Result Types Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/result/README.en-US.md
Provides an example showcasing all available status types for the Result component. This can be used for testing or demonstration purposes.
```vue
```
--------------------------------
### Build Production Application
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/arco-vue-docs/docs/pro/npm-scripts.en-US.md
Execute this command to build the production-ready application. It includes type checking with vue-tsc and then proceeds with the Vite build process using a production configuration file.
```bash
npm run build
```
```json
{
"scripts": {
"build": "vue-tsc --noEmit && vite build --config ./config/vite.config.prod.ts"
}
}
```
--------------------------------
### All Result Types Example - Vue
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/result/TEMPLATE.md
Provides an example showcasing all available status types for the Result component, demonstrating their appearance and usage.
```vue
```
--------------------------------
### Basic Popover Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/popover/README.en-US.md
Demonstrates the basic usage of the Popover component. Ensure the Popover component is imported and registered before use.
```vue
Content
Hover me
```
--------------------------------
### Arco Design Vue Trigger Basic Usage Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/trigger/__demo__/basic.md
This example shows the most basic usage of the trigger. It includes examples for hover, click, and focus triggers, with unmountOnClose set to false for hover and click triggers. The content of the trigger is an empty state component with custom styling.
```vue
Hover Me
Click Me
```
--------------------------------
### Basic ResizeBox Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/resize-box/__demo__/basic.md
Demonstrates the basic usage of the ResizeBox component. The `directions` prop is set to 'right' and 'bottom', allowing resizing only on these sides. Includes style configurations for width, minWidth, maxWidth, and height.
```vue
We are building the future of content discovery and
creation.
ByteDance's content platforms enable people to enjoy content powered by
AI technology. We inform, entertain, and inspire people across language,
culture and geography.
ByteDanceYiming Zhang is the founder and CEO of
ByteDance.
```
--------------------------------
### Basic ColorPicker Usage
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/color-picker/TEMPLATE.md
Demonstrates the basic implementation of the ColorPicker component. No specific setup is required beyond importing the component.
```vue
```
--------------------------------
### Simple Transfer Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/transfer/TEMPLATE.md
A minimal example of the Transfer component, focusing on core functionality with default settings. Suitable for basic selection tasks.
```vue
```
--------------------------------
### Basic Pagination Usage
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/pagination/TEMPLATE.md
Demonstrates the basic setup for the Pagination component. No specific imports are required beyond the component itself.
```vue
```
--------------------------------
### Vue Retractable Sidebar Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/layout/__demo__/resize.md
Use the `resizeDirections` prop on `a-layout-sider` to enable mouse-based resizing. This example allows resizing from the right edge.
```vue
Header Sider ContentFooter
```
--------------------------------
### Complex Descriptions Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/descriptions/TEMPLATE.md
A comprehensive example showcasing various features of the Descriptions component, including different layouts, alignments, and bordered styles.
```vue
Arco Design Vue18100000000Arco Design Vue18100000000Hangzhou, Zhejiang, Chinaarco.design@example.comarco.designActiveThis is a longer note that spans two columns.
```
--------------------------------
### Bordered Descriptions Example
Source: https://github.com/arco-design/arco-design-vue/blob/main/packages/web-vue/components/descriptions/__demo__/bordered.md
A basic example of the Descriptions component configured with the 'bordered' prop to display user information with borders and background colors.
```vue
```