@el-plus/ui 0.0.4 → 0.0.6

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # el-plus
2
2
 
3
+ ## 0.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: ts类型修改
8
+
9
+ ## 0.0.5
10
+
11
+ ### Patch Changes
12
+
13
+ - docs: README.md
14
+
3
15
  ## 0.0.4
4
16
 
5
17
  ### Patch Changes
package/README.md ADDED
@@ -0,0 +1,85 @@
1
+ 基于 pnpm workspace + ts + element-plus 开发
2
+
3
+ ## 完整引入
4
+
5
+ ```bash
6
+ import ElPlus from 'el-plus'
7
+ import 'el-plus/dist/index.css'
8
+ app.use(ElPlus)
9
+ ```
10
+
11
+ ### Volar 支持
12
+ 如果您使用 Volar,请在 tsconfig.json 中通过 compilerOptions.type 指定全局组件类型。
13
+
14
+ ```
15
+ {
16
+ "compilerOptions": {
17
+ // ...
18
+ "types": ["el-plus/global"]
19
+ }
20
+ }
21
+ ```
22
+ ## 按需导入方式1 (<b style="color:red">简单</b>)
23
+ ```js
24
+ // main.ts
25
+ import 'el-plus/dist/index.css' // 引入所有样式
26
+ // xx.vue
27
+ import { ElButtons } from 'el-plus'
28
+
29
+ ```
30
+ ## 按需导入导入方式2 (待增加)
31
+ 您需要使用额外的插件来导入要使用的组件。
32
+ ### 自动导入 (<b style="color:red">推荐</b>)
33
+ 首先你需要安装[`unplugin-vue-components`](https://github.com/unplugin/unplugin-vue-components#installation) 和 [`unplugin-auto-import`](https://github.com/unplugin/unplugin-auto-import#install)这两款插件
34
+ ``` bash
35
+ $ npm install -D unplugin-vue-components unplugin-auto-import
36
+ ```
37
+ 然后把下列代码插入到你的 Vite 或 Webpack 的配置文件中
38
+
39
+ ```js
40
+ import { defineConfig } from 'vite'
41
+ import AutoImport from 'unplugin-auto-import/vite'
42
+ import Components from 'unplugin-vue-components/vite'
43
+ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
44
+
45
+ export default defineConfig({
46
+ // ...
47
+ plugins: [
48
+ // ...
49
+ AutoImport({
50
+ resolvers: [ElementPlusResolver()],
51
+ }),
52
+ Components({
53
+ resolvers: [ElementPlusResolver()],
54
+ }),
55
+ ],
56
+ })
57
+
58
+ ```
59
+ ### 手动导入
60
+ 在vue文件中import即可,但需要安装 `unplugin-element-plus` 来导入样式,配置文档参考[docs](https://github.com/element-plus/unplugin-element-plus#readme)
61
+ ``` js
62
+ <template>
63
+ <el-button>I am ElButton</el-button>
64
+ </template>
65
+
66
+ <script>
67
+ import { ElButton } from 'element-plus'
68
+
69
+ export default {
70
+ components: { ElButton },
71
+ }
72
+ </script>
73
+ ```
74
+ ```js
75
+ import { defineConfig } from 'vite'
76
+ import ElementPlus from 'unplugin-element-plus/vite'
77
+
78
+ export default defineConfig({
79
+ // ...
80
+ plugins: [ElementPlus({
81
+ lib:'el-plus'
82
+ })],
83
+ })
84
+ ```
85
+
package/components.ts CHANGED
@@ -5,5 +5,14 @@ import Input from '@el-plus/components/input'
5
5
  import SearchListPage from '@el-plus/components/searchListPage'
6
6
  import Select from '@el-plus/components/select'
7
7
  import Table from '@el-plus/components/table'
8
+ import Title from '@el-plus/components/title'
8
9
 
9
- export default [Buttons, Form, Input, SearchListPage, Select, Table] as Plugin[]
10
+ export default [
11
+ Buttons,
12
+ Form,
13
+ Input,
14
+ SearchListPage,
15
+ Select,
16
+ Table,
17
+ Title,
18
+ ] as Plugin[]
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@el-plus/ui",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "pro base on element-plus",
5
5
  "module": "index.ts",
6
6
  "keywords": [
7
7
  "element-plus",
8
- "vue3"
8
+ "vue3",
9
+ "typescript"
9
10
  ],
10
11
  "author": "pengfei.yin",
11
12
  "license": "MIT",