wiser-components 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +17 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -5,29 +5,39 @@
5
5
  ## 安装
6
6
 
7
7
  ```bash
8
+ # 安装组件库
8
9
  npm install wiser-components
9
- ```
10
-
11
- **注意**:本组件库依赖于 Element-UI,使用前请确保已安装:
12
10
 
13
- ```bash
11
+ # 安装依赖(必需!)
14
12
  npm install element-ui
15
13
  ```
16
14
 
15
+ **重要提示**:
16
+ 1. 本组件库**必须**依赖 Element-UI,使用前必须先安装 Element-UI
17
+ 2. Element-UI 必须在组件库**之前**引入和注册
18
+ 3. 必须引入 Element-UI 的样式文件
19
+
17
20
  ## 使用
18
21
 
19
22
  ### 完整引入
20
23
 
21
24
  ```javascript
22
25
  import Vue from 'vue'
26
+
27
+ // ⚠️ 重要:必须先引入 Element-UI
23
28
  import ElementUI from 'element-ui'
24
- import 'element-ui/lib/theme-chalk/index.css'
29
+ import 'element-ui/lib/theme-chalk/index.css' // 必须引入样式
30
+
31
+ // 然后引入组件库
25
32
  import WiserComponents from 'wiser-components'
26
33
 
27
- Vue.use(ElementUI)
28
- Vue.use(WiserComponents)
34
+ // 注册顺序:先注册 Element-UI,再注册组件库
35
+ Vue.use(ElementUI) // 第一步:注册 Element-UI
36
+ Vue.use(WiserComponents) // 第二步:注册组件库
29
37
  ```
30
38
 
39
+ **⚠️ 注意**:如果引入顺序错误,组件将无法正常渲染!
40
+
31
41
  ### 按需引入
32
42
 
33
43
  ```javascript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wiser-components",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "A Vue2 component library",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",