Skip to content

I. Environment Requirements

ToolVersion RequirementDescription
Node.js≥ 18.x (Recommended ≥20.x)Mainstream LTS version
Vue≥ 3.3.XVue 3 official version
pnpm≥ 10.Xpnpm installation

II. Installation

sh
npm install vue-element-plus-x --save
sh
pnpm add vue-element-plus-x --save
sh
yarn add vue-element-plus-x --save

CDN Import (Optional)

We recommend installing via a package manager. If you want to use a CDN build, please verify the published artifacts:

html
<script src="https://unpkg.com/vue-element-plus-x@latest/dist/umd/index.js"></script>

III. Usage

Built-in Tree Shaking optimization. Both on-demand import and full import are supported.

  1. On-demand Import
vue
<script setup>
import { BubbleList, XSender } from 'vue-element-plus-x';

const list = [
  {
    content: 'Hello, Element Plus X',
    role: 'user'
  }
];
</script>

<template>
  <div
    style="display: flex; flex-direction: column; height: 230px; justify-content: space-between;"
  >
    <BubbleList :list="list" />
    <XSender />
  </div>
</template>
  1. Full Import
ts
// main.ts
import { createApp } from 'vue';
import ElementPlusX from 'vue-element-plus-x';
import App from './App.vue';

const app = createApp(App);
// Use app.use() for global import
app.use(ElementPlusX);
app.mount('#app');