Skip to content

Commit 04838b2

Browse files
committed
更新 README 文件,增加安装与使用说明,添加环境要求和安装步骤,提供完整引入 Element Plus 的示例及按需引入的示例。
1 parent b4acc19 commit 04838b2

File tree

2 files changed

+121
-3
lines changed

2 files changed

+121
-3
lines changed

README.en.md

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,71 @@ A powerful Vue 3 mathematical expression editor component that supports variable
4141
- Scientific calculator applications
4242
- Mathematical education tools
4343

44-
## Installation
44+
## Installation and Usage
45+
46+
### Requirements
47+
48+
This component depends on:
49+
- Vue >= 3.3.0
50+
- Element Plus >= 2.4.0
51+
52+
### Installation Steps
53+
54+
1. First, ensure you have the required dependencies installed in your project:
55+
56+
```bash
57+
npm install vue@^3.3.0 element-plus@^2.4.0
58+
```
59+
60+
2. Install vue-expression-editor:
4561

4662
```bash
4763
npm install vue-expression-editor
4864
```
4965

66+
3. Fully import Element Plus in your entry file (e.g., main.ts or main.js):
67+
68+
```javascript
69+
import { createApp } from 'vue'
70+
import ElementPlus from 'element-plus'
71+
import 'element-plus/dist/index.css'
72+
import App from './App.vue'
73+
74+
const app = createApp(App)
75+
app.use(ElementPlus)
76+
app.mount('#app')
77+
```
78+
79+
If you're using on-demand importing, make sure to import the required components and their styles:
80+
81+
```javascript
82+
import { createApp } from 'vue'
83+
import {
84+
ElButton,
85+
ElInput,
86+
ElPopover,
87+
ElDialog,
88+
ElSwitch,
89+
ElTooltip
90+
} from 'element-plus'
91+
import 'element-plus/es/components/button/style/css'
92+
import 'element-plus/es/components/input/style/css'
93+
import 'element-plus/es/components/popover/style/css'
94+
import 'element-plus/es/components/dialog/style/css'
95+
import 'element-plus/es/components/switch/style/css'
96+
import 'element-plus/es/components/tooltip/style/css'
97+
import App from './App.vue'
98+
99+
const app = createApp(App)
100+
app.use(ElButton)
101+
app.use(ElInput)
102+
app.use(ElPopover)
103+
app.use(ElDialog)
104+
app.use(ElSwitch)
105+
app.use(ElTooltip)
106+
app.mount('#app')
107+
```
108+
50109
## Basic Usage
51110

52111
```vue

README.md

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,72 @@
4141
- 科学计算器应用
4242
- 数学教育工具
4343

44-
## 安装
44+
## 安装与使用
45+
46+
### 环境要求
47+
48+
本组件依赖以下库:
49+
- Vue >= 3.3.0
50+
- Element Plus >= 2.4.0
51+
52+
### 安装步骤
53+
54+
1. 首先确保你的项目中已安装必需的依赖:
55+
56+
```bash
57+
npm install vue@^3.3.0 element-plus@^2.4.0
58+
```
59+
60+
2. 安装vue-expression-editor:
4561

4662
```bash
4763
npm install vue-expression-editor
4864
```
4965

50-
## 基础用法
66+
3. 在你的项目入口文件(如main.ts或main.js)中完整引入Element Plus:
67+
68+
```javascript
69+
import { createApp } from 'vue'
70+
import ElementPlus from 'element-plus'
71+
import 'element-plus/dist/index.css'
72+
import App from './App.vue'
73+
74+
const app = createApp(App)
75+
app.use(ElementPlus)
76+
app.mount('#app')
77+
```
78+
79+
如果你使用的是按需引入,请确保引入了组件使用的相关组件和样式:
80+
81+
```javascript
82+
import { createApp } from 'vue'
83+
import {
84+
ElButton,
85+
ElInput,
86+
ElPopover,
87+
ElDialog,
88+
ElSwitch,
89+
ElTooltip
90+
} from 'element-plus'
91+
import 'element-plus/es/components/button/style/css'
92+
import 'element-plus/es/components/input/style/css'
93+
import 'element-plus/es/components/popover/style/css'
94+
import 'element-plus/es/components/dialog/style/css'
95+
import 'element-plus/es/components/switch/style/css'
96+
import 'element-plus/es/components/tooltip/style/css'
97+
import App from './App.vue'
98+
99+
const app = createApp(App)
100+
app.use(ElButton)
101+
app.use(ElInput)
102+
app.use(ElPopover)
103+
app.use(ElDialog)
104+
app.use(ElSwitch)
105+
app.use(ElTooltip)
106+
app.mount('#app')
107+
```
108+
109+
### 基础用法
51110

52111
```vue
53112
<template>

0 commit comments

Comments
 (0)