@elementplus-kit/uikit 1.6.0 → 1.8.0

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 (68) hide show
  1. package/components/button/index.ts +2 -0
  2. package/components/button/src/constants.ts +50 -0
  3. package/components/button/src/index.ts +269 -0
  4. package/components/button/src/type.ts +15 -0
  5. package/components/button/style/index.scss +3 -0
  6. package/components/config.ts +4 -0
  7. package/components/dialog/index.ts +2 -0
  8. package/components/dialog/src/constants.ts +3 -0
  9. package/components/dialog/src/index.ts +54 -0
  10. package/components/dialog/src/type.ts +1 -0
  11. package/components/dialog/style/index.scss +18 -0
  12. package/components/dictLabel/index.ts +4 -0
  13. package/components/dictLabel/src/index.vue +21 -0
  14. package/components/dictLabel/src/type.ts +1 -0
  15. package/components/drawer/index.ts +2 -0
  16. package/components/drawer/src/constants.ts +3 -0
  17. package/components/drawer/src/index.ts +53 -0
  18. package/components/drawer/src/type.ts +1 -0
  19. package/components/drawer/style/index.scss +18 -0
  20. package/components/form/index.ts +2 -0
  21. package/components/form/src/FormItem.ts +406 -0
  22. package/components/form/src/constants.ts +161 -0
  23. package/components/form/src/index.ts +198 -0
  24. package/components/form/src/type.ts +68 -0
  25. package/components/form/src/utils.ts +4 -0
  26. package/components/form/style/index.scss +5 -0
  27. package/components/importText/index.ts +2 -0
  28. package/components/importText/src/index.ts +1 -0
  29. package/components/importText/src/type.ts +3 -0
  30. package/components/index.ts +10 -31
  31. package/components/pagination/index.ts +2 -0
  32. package/components/pagination/src/constants.ts +5 -0
  33. package/components/pagination/src/index.ts +50 -0
  34. package/components/pagination/src/type.ts +1 -0
  35. package/components/search/index.ts +2 -0
  36. package/components/search/src/index.tsx +306 -0
  37. package/components/search/src/type.ts +2 -0
  38. package/components/search/style/index.scss +104 -0
  39. package/components/table/index.ts +2 -0
  40. package/components/table/src/TableColumn.ts +116 -0
  41. package/components/table/src/constants.ts +42 -0
  42. package/components/table/src/index.ts +251 -0
  43. package/components/table/src/tableDictLabel.vue +21 -0
  44. package/components/table/src/type.ts +19 -0
  45. package/components/table/type/index.scss +0 -0
  46. package/components/table2/index.ts +4 -0
  47. package/components/table2/src/config.ts +5 -0
  48. package/components/table2/src/index.ts +12 -0
  49. package/components/table2/src/render.ts +136 -0
  50. package/components/table2/src/types.ts +39 -0
  51. package/components/table2/style/index.scss +0 -0
  52. package/components//346/250/241/346/235/277/index.tsx +57 -0
  53. package/components//346/250/241/346/235/277/ttt.ts +66 -0
  54. package/components//346/250/241/346/235/277/ttt.vue +18 -0
  55. package/index.ts +2 -0
  56. package/package.json +1 -4
  57. package/vite.config.ts +30 -0
  58. package//345/205/266/344/273/226/core/dialog/elementPlus/dialogWarp.vue +151 -0
  59. package//345/205/266/344/273/226/core/dialog/index.ts +10 -0
  60. package//345/205/266/344/273/226/core/form/elementPlus/elementWarp.ts +15 -0
  61. package//345/205/266/344/273/226/core/form/elementPlus/elementWarp.vue +16 -0
  62. package//345/205/266/344/273/226/core/form/elementPlus/formRender.ts +55 -0
  63. package//345/205/266/344/273/226/core/form/index.ts +10 -0
  64. package//345/205/266/344/273/226/core/table/config.ts +5 -0
  65. package//345/205/266/344/273/226/core/table/render.ts +91 -0
  66. package//345/205/266/344/273/226/core/table/warp.ts +11 -0
  67. package//345/205/266/344/273/226/core/utils/fetch.ts +58 -0
  68. package//345/205/266/344/273/226/useMessage.ts +95 -0
@@ -0,0 +1,251 @@
1
+ import {
2
+ defineComponent,
3
+ h,
4
+ getCurrentInstance,
5
+ type ExtractPropTypes,
6
+ } from "vue";
7
+ import { ElTable, ElTableColumn } from "element-plus";
8
+ import TableDictLabel from "./tableDictLabel.vue";
9
+ import {
10
+ defaultAttrs,
11
+ tableSlots,
12
+ tablecolumnSlots,
13
+ selectionColumn,
14
+ indexColumn,
15
+ } from "./constants.ts";
16
+ import { isArray, isObject, isFunction } from "lodash-es";
17
+ const tableAttrs = {
18
+ module: {
19
+ type: Object,
20
+ default: () => {},
21
+ },
22
+ params: {
23
+ // 额外业务全局参数
24
+ type: Object,
25
+ default: () => {},
26
+ },
27
+ // isRadio: { // 是否为单选框
28
+ // type: Boolean,
29
+ // default: false,
30
+ // },
31
+ // isCheckbox: { // 是否为复选框
32
+ // type: Boolean,
33
+ // default: false,
34
+ // },
35
+ columns: {
36
+ // 列数据
37
+ type: Array,
38
+ default: () => [],
39
+ },
40
+ showSelection: {
41
+ // 是否显示选择列
42
+ type: Boolean,
43
+ default: false,
44
+ },
45
+ showIndex: {
46
+ // 是否显示索引列
47
+ type: Boolean,
48
+ default: false,
49
+ },
50
+ };
51
+
52
+ // 类型处理
53
+ export type TableAttrs = ExtractPropTypes<typeof tableAttrs>;
54
+
55
+ export default defineComponent({
56
+ props: tableAttrs,
57
+ // emits: eventList,
58
+
59
+ // attrs, emit会继承, slots需要设置
60
+ setup(props: TableAttrs, { attrs, emit, slots, expose }) {
61
+ // 暴露elTable组件上的方法
62
+ const vm = getCurrentInstance(); // 获取虚拟DOM实例
63
+ const cTableFnRef = (el) => {
64
+ if (!el) return;
65
+ vm.exposed = el; // 设置暴露对象
66
+ vm.exposeProxy = el; // 设置代理暴露对象
67
+ };
68
+
69
+ // 暴露方法
70
+ // expose({
71
+ // // tableRef,
72
+ // });
73
+
74
+ // // 属性处理
75
+ // const getAttrs = () => {
76
+ // const obj = {
77
+ // ...defaultAttrs, // 设置默认值
78
+ // };
79
+ // return obj;
80
+ // };
81
+ // // 事件处理
82
+ // const getEvents = () => {
83
+ // const obj = {
84
+ // ...defaultAttrs, // 设置默认值
85
+ // };
86
+ // return obj;
87
+ // };
88
+
89
+ // // 处理列数据-数组
90
+ // const getArrayColumn = () => {
91
+ // // 递归处理数据
92
+ // const list = [];
93
+
94
+ // const columnsRecursion = (columns, list) => {
95
+ // columns?.map((item) => {
96
+ // const { children, ...p } = item;
97
+ // // 递归处理子列
98
+ // if (isArray(item.children)) {
99
+ // item.children = c(item.children, list);
100
+ // }
101
+ // list.push(p);
102
+ // });
103
+ // };
104
+ // columnsRecursion(props.columns, list);
105
+ // return list;
106
+ // };
107
+
108
+ // 渲染表格列
109
+ const renderTableColumn = () => {
110
+ const list = [];
111
+ // 处理多选与序号列
112
+ if (props.showSelection) {
113
+ list.push(
114
+ h(ElTableColumn, {
115
+ type: "selection",
116
+ width: 50,
117
+ align: "center",
118
+ })
119
+ );
120
+ }
121
+ if (props.showIndex) {
122
+ list.push(
123
+ h(ElTableColumn, {
124
+ label: "序号",
125
+ type: "index",
126
+ width: 60,
127
+ align: "center",
128
+ })
129
+ );
130
+ }
131
+
132
+ // 列递归渲染
133
+ const rColumn = (columns, list) => {
134
+ columns.map((item) => {
135
+ const { children, ...p } = item;
136
+ // 处理 vIf true 显示 false 隐藏
137
+ if (
138
+ isFunction(item.vIf) &&
139
+ item.vIf(props.params) !== undefined &&
140
+ !item.vIf(props.params)
141
+ ) {
142
+ return;
143
+ }
144
+
145
+ // 处理多级表头
146
+ const listSub = [];
147
+ if (children?.length) {
148
+ rColumn(children, listSub);
149
+ }
150
+
151
+ // 处理插槽
152
+ const itemSlot = {};
153
+ // column 自带插槽
154
+ tablecolumnSlots.map((name) => {
155
+ const slotName = `${item.prop}.${name}`;
156
+ if (slots[slotName]) {
157
+ itemSlot[name] = slots[slotName];
158
+ }
159
+ });
160
+
161
+ // column 列插槽
162
+ if (slots[item.prop]) {
163
+ itemSlot["default"] = slots[item.prop];
164
+ } else if (isFunction(item.render)) {
165
+ // column render 渲染函数
166
+ itemSlot["default"] = item.render;
167
+ } else if (isArray(item.options)) {
168
+ // column 字典数组
169
+ itemSlot["default"] = (scope: any) =>
170
+ h(TableDictLabel, {
171
+ options: item.options,
172
+ value: scope.row[item.prop],
173
+ });
174
+ }
175
+
176
+ // 赋值 有插槽
177
+ if (Object.keys(itemSlot).length) {
178
+ const getColumnContent = () => {
179
+ let content = undefined;
180
+ if (listSub.length) {
181
+ content = { ...itemSlot, default: () => listSub };
182
+ } else {
183
+ content = { ...itemSlot };
184
+ }
185
+ return content;
186
+ };
187
+ list.push(
188
+ h(
189
+ ElTableColumn,
190
+ { ...p, class: "c-table-column" },
191
+ getColumnContent()
192
+ )
193
+ );
194
+ } else {
195
+ const getColumnContent = () => {
196
+ let content = undefined;
197
+ if (listSub.length) {
198
+ content = { default: () => listSub };
199
+ }
200
+ return content;
201
+ };
202
+ // 无插槽
203
+ list.push(
204
+ h(
205
+ ElTableColumn,
206
+ { ...p, class: "c-table-column" },
207
+ getColumnContent()
208
+ )
209
+ );
210
+ }
211
+ });
212
+ };
213
+ rColumn(props.columns, list);
214
+ return list;
215
+ };
216
+
217
+ // 插槽处理
218
+ const getSlots = () => {
219
+ const obj = {};
220
+ tableSlots.map((name) => {
221
+ if (slots[name]) {
222
+ obj[name] = slots[name];
223
+ }
224
+ });
225
+ return obj;
226
+ };
227
+ // 渲染表格组件
228
+ const renderTable = () => {
229
+ // getColumnList();
230
+ // console.log("props", props);
231
+ // console.log("attrs", attrs);
232
+ // 先拼接好子数据不然会重复执行多次
233
+ const columnList = renderTableColumn();
234
+ return h(
235
+ ElTable,
236
+ {
237
+ ref: cTableFnRef,
238
+ ...attrs,
239
+ class: "c-table",
240
+ },
241
+ {
242
+ default: () => columnList,
243
+ ...getSlots(),
244
+ }
245
+ );
246
+ };
247
+
248
+ // 返回渲染函数
249
+ return () => renderTable();
250
+ },
251
+ });
@@ -0,0 +1,21 @@
1
+ <template>
2
+ {{ label }}
3
+ </template>
4
+ <script setup lang="ts">
5
+ import { computed, PropType } from 'vue'
6
+ const props = defineProps({
7
+ options: {
8
+ type: Array,
9
+ default: () => []
10
+ },
11
+ value: {
12
+ type: String as PropType<any>,
13
+ default: ''
14
+ },
15
+ })
16
+ const label = computed(() => {
17
+ // 处理value为数字的情况 后端字典都是字符串
18
+ const item = props.options?.find((item) => item.value == props.value.toString());
19
+ return item?.label || props.value;
20
+ });
21
+ </script>
@@ -0,0 +1,19 @@
1
+ import { type ExtractPropTypes } from "vue";
2
+ import type { TableColumnCtx } from "element-plus";
3
+ import elTableDefaults from "element-plus/es/components/table/src/table/defaults";
4
+ type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never; // 展开类型工具
5
+
6
+ import { type TableAttrs } from "./index.ts";
7
+
8
+ // 表格属性
9
+ type ElTableProps = ExtractPropTypes<typeof elTableDefaults>;
10
+ export type TableProps = Expand<Partial<TableAttrs>> &
11
+ Expand<Partial<ElTableProps>>;
12
+
13
+ // 表格项属性
14
+ export type TableColumnProps = {
15
+ vIf?: (params: any) => boolean;
16
+ render?: (scope: any) => any;
17
+ options?: Array<{ label: string; value: any }>;
18
+ children?: Array<TableColumnProps>;
19
+ } & Expand<Partial<TableColumnCtx>>;
File without changes
@@ -0,0 +1,4 @@
1
+ import Table2 from "./src/index";
2
+ export * from "./src/index";
3
+ export { Table2 };
4
+ export default Table2;
@@ -0,0 +1,5 @@
1
+ export const TABLE_CONFIG = {
2
+ OPERATION_COL_LABEL: '操作',
3
+ OPERATION_SLOT_NAME: 'custom',
4
+ CHILDREN_SLOT_KEY: 'children'
5
+ }
@@ -0,0 +1,12 @@
1
+ import { defineComponent } from "vue";
2
+ import render from "./render.ts";
3
+
4
+ export default defineComponent({
5
+ props: ["schema", "data"],
6
+ emits: [],
7
+ setup(props: any, { attrs, emit, slots, expose }) {
8
+ return () => {
9
+ return render(props.schema, props.data, emit, slots);
10
+ };
11
+ },
12
+ });
@@ -0,0 +1,136 @@
1
+ import { h } from "vue";
2
+ import { ElTable, ElTableColumn } from "element-plus";
3
+ import _ from "lodash-es";
4
+ import { TABLE_CONFIG } from "./config.ts";
5
+
6
+ function render(schema: any, data: any, emit: any, slots: any) {
7
+ const renderSlots = {
8
+ default: () => {
9
+ return buildSlots(schema, slots);
10
+ },
11
+ };
12
+ return h(ElTable, { data, class: "c-table" }, renderSlots);
13
+ }
14
+
15
+ function buildSlots(schema: any, slots: any) {
16
+ const children: any[] = [];
17
+ // 渲染表格列子组件
18
+ if (_.isObject(schema)) {
19
+ let columnsKeys = Object.keys(schema);
20
+ columnsKeys.forEach((columnKey) => {
21
+ let colSchema = schema[columnKey];
22
+ let colSlots = slots[columnKey];
23
+ // 如果有列表头插槽
24
+ if (slots[`${columnKey}.header`]) {
25
+ let props = buildColumnProps(columnKey, colSchema);
26
+ let headerSlot = {
27
+ header: (scope: any) => {
28
+ // 调用插槽函数才能传参
29
+ return slots[`${columnKey}.header`](scope);
30
+ },
31
+ };
32
+ if (slots[columnKey]) {
33
+ headerSlot.default = (scope: any) => {
34
+ return [slots[columnKey](scope)];
35
+ };
36
+ }
37
+ children.push(h(ElTableColumn, props, headerSlot));
38
+ } else {
39
+ children.push(buildColumns(columnKey, colSchema, colSlots, slots));
40
+ }
41
+ });
42
+ }
43
+
44
+ // 额外插槽处理
45
+ // 增加插槽式操作栏 判断是否有操作列名称的插槽
46
+ if (slots[TABLE_CONFIG.OPERATION_SLOT_NAME]) {
47
+ // 如果有列表头插槽
48
+ let scopeProp = { label: TABLE_CONFIG.OPERATION_COL_LABEL };
49
+
50
+ if (slots[`${TABLE_CONFIG.OPERATION_SLOT_NAME}.header`]) {
51
+ let headerSlot = {
52
+ header: (scope: any) => {
53
+ // 调用插槽函数才能传参
54
+ return slots[`${TABLE_CONFIG.OPERATION_SLOT_NAME}.header`](scope);
55
+ },
56
+ default: (scope: any) => {
57
+ return [slots[TABLE_CONFIG.OPERATION_SLOT_NAME](scope)];
58
+ },
59
+ };
60
+ children.push(h(ElTableColumn, scopeProp, headerSlot));
61
+ } else {
62
+ let scopeSlots = {
63
+ default: (scope: any) => {
64
+ return [slots[TABLE_CONFIG.OPERATION_SLOT_NAME](scope)];
65
+ },
66
+ };
67
+ children.push(h(ElTableColumn, scopeProp, scopeSlots));
68
+ }
69
+ }
70
+ return children;
71
+ }
72
+
73
+ function buildColumns(
74
+ columnKey: any,
75
+ option: any,
76
+ slots: any,
77
+ globalSlots: any
78
+ ) {
79
+ // 组装props
80
+ let props = buildColumnProps(columnKey, option);
81
+ // 过滤出 children 多级表头配置 消除vue警告
82
+ delete props[TABLE_CONFIG.CHILDREN_SLOT_KEY];
83
+
84
+ let renderSlotsArr = [];
85
+ // 多级表头组合
86
+ if (
87
+ option[TABLE_CONFIG.CHILDREN_SLOT_KEY] &&
88
+ _.isObject(option[TABLE_CONFIG.CHILDREN_SLOT_KEY])
89
+ ) {
90
+ let scopeOption = option[TABLE_CONFIG.CHILDREN_SLOT_KEY];
91
+ if (_.isObject(scopeOption)) {
92
+ let columnsKeys = Object.keys(scopeOption);
93
+ columnsKeys.forEach((columnKey) => {
94
+ let colSchema = scopeOption[columnKey];
95
+ let colSlots = globalSlots[columnKey];
96
+ renderSlotsArr.push(
97
+ buildColumns(columnKey, colSchema, colSlots, globalSlots)
98
+ );
99
+ });
100
+ }
101
+ }
102
+
103
+ let renderSlots = () => [];
104
+
105
+ if (slots) {
106
+ renderSlots = {
107
+ default: (scope) => {
108
+ return [...renderSlotsArr, slots(scope)];
109
+ },
110
+ };
111
+ } else {
112
+ renderSlots = {
113
+ default: () => {
114
+ return [...renderSlotsArr];
115
+ },
116
+ };
117
+ }
118
+
119
+ return h(ElTableColumn, props, renderSlots);
120
+ }
121
+
122
+ function buildColumnProps(key: string, option: any) {
123
+ if (_.isString(option)) {
124
+ return {
125
+ prop: key,
126
+ label: option,
127
+ };
128
+ } else if (_.isObject(option)) {
129
+ return {
130
+ prop: key,
131
+ ...option,
132
+ };
133
+ }
134
+ }
135
+
136
+ export default render;
@@ -0,0 +1,39 @@
1
+ export interface FormItemListItem {
2
+ type: string
3
+ label?: string
4
+ prop: string
5
+ required?: Boolean
6
+ vIf?: boolean | ((item: FormItemListItem) => boolean)
7
+ dictType?: string
8
+ options?: Array<Object>
9
+ col?: Number
10
+ formItem?: Object
11
+ attrs?: Object
12
+ }
13
+
14
+ export interface FormItemList {
15
+ module: Object
16
+ formOpsions: FormItemListItem[]
17
+ readonly: boolean
18
+ }
19
+
20
+ export type formType =
21
+ | 'input'
22
+ | 'textarea'
23
+ | 'input-number'
24
+ | 'select'
25
+ | 'select-v2'
26
+ | 'cascader'
27
+ | 'tree-select'
28
+ | 'radio'
29
+ | 'checkbox'
30
+ | 'time-select'
31
+ | 'date-picker'
32
+ | 'time-picker'
33
+ | 'rate'
34
+ | 'color-picker'
35
+ | 'slider'
36
+ | 'switch'
37
+ | 'text'
38
+ | 'html'
39
+ | 'slot'
File without changes
@@ -0,0 +1,57 @@
1
+ import {
2
+ ref,
3
+ computed,
4
+ defineComponent,
5
+ } from "vue";
6
+
7
+ // import { CForm, CDrawer } from "@elementplus-kit/uikit";
8
+ // import '../style/index.scss';
9
+
10
+ export default defineComponent({
11
+ props: {
12
+ // modelValue: {
13
+ // type: Object,
14
+ // default: {}
15
+ // },
16
+ // formOptions: {
17
+ // type: Array,
18
+ // default: () => []
19
+ // },
20
+ // isDrawer: {
21
+ // type: Boolean,
22
+ // default: false
23
+ // },
24
+ },
25
+ // emits: ['update:modelValue', 'search', 'reset', 'close'],
26
+
27
+ setup(props, { emit, slots, attrs, expose }) {
28
+ // 自己的 slot
29
+ // const slotsList = ["active", "btn-left", "btn-right"];
30
+ // console.log('slots', slots);
31
+ // console.log('attrs', attrs);
32
+ // 解析 attrs 中的事件
33
+ // const getEvent = () => {
34
+ // let formObj: any = {};
35
+ // Object.keys(attrs)?.forEach((name) => {
36
+ // if (name.indexOf("on") === 0) {
37
+ // formObj[name] = attrs[name];
38
+ // }
39
+ // })
40
+ // return formObj
41
+ // };
42
+
43
+ // 解析插槽
44
+ // const getSlot = () => {
45
+ // let formObj = {};
46
+ // Object.keys(slots).forEach((key) => {
47
+ // if (!slotsList.includes(key)) {
48
+ // formObj[key] = slots[key];
49
+ // }
50
+ // });
51
+ // return formObj
52
+ // };
53
+ return () => (
54
+ <div className="xxxxxxx">xxxxxxx</div>
55
+ )
56
+ },
57
+ })
@@ -0,0 +1,66 @@
1
+ import {
2
+ ref,
3
+ h,
4
+ computed,
5
+ toRefs,
6
+ getCurrentInstance,
7
+ provide,
8
+ defineComponent,
9
+ type ExtractPropTypes,
10
+ type PropType,
11
+ } from 'vue'
12
+ import { ElConfigProvider, ElForm, ElRow, ElCol } from 'element-plus'
13
+ import zhCn from 'element-plus/es/locale/lang/zh-cn'
14
+ import { get, has, isArray, isBoolean, isFunction, isNumber } from 'lodash-es'
15
+
16
+
17
+ const propsAttrs = {
18
+ // 表单数据
19
+ model: { type: Object, default: () => ({}) },
20
+ // 表单项
21
+ formOptions: { type: Array, default: () => [] },
22
+ }
23
+
24
+ export type PropsAttrs = ExtractPropTypes<typeof propsAttrs>
25
+
26
+ export default defineComponent({
27
+ props: propsAttrs,
28
+ emits: [...getEmits()],
29
+ setup(props: PropsAttrs, { attrs: $attrs, emit, slots, expose }) {
30
+
31
+ // 暴露方法
32
+ expose({
33
+ optionsRef,
34
+ })
35
+
36
+ // 解构props
37
+ const { model, formOptions, readonly, gutter, col } = toRefs(props)
38
+
39
+ // 渲染表单
40
+ const renderForm = () => {
41
+ return h(
42
+ ElConfigProvider,
43
+ {
44
+ locale: zhCn,
45
+ },
46
+ {
47
+ default: () =>
48
+ h(
49
+ ElForm,
50
+ {
51
+ ref: cFormFnRef,
52
+ ...$attrs,
53
+ class: allReadonly.value ? 'isReadonly c-form' : 'c-form', // 放在 $attrs 后面可自动合并 放在 $attrs 前面会被 $attrs.class 覆盖, h函数渲染的是标签就会覆盖 是组件就会合并不用管顺序
54
+ },
55
+ {
56
+ default: () => renderRow(),
57
+ },
58
+ ),
59
+ },
60
+ )
61
+ }
62
+
63
+ // 返回渲染函数
64
+ return () => renderForm()
65
+ },
66
+ })
@@ -0,0 +1,18 @@
1
+ <template>
2
+ <div class="xxx">
3
+
4
+ </div>
5
+ </template>
6
+ <script setup lang="ts">
7
+ import { ref, computed, useAttrs, useSlots, defineModel } from 'vue'
8
+ import { ArrowUpBold } from '@element-plus/icons-vue'
9
+ const props = defineProps({
10
+ formOptions: {
11
+ type: Array,
12
+ default: () => []
13
+ },
14
+ })
15
+ const emit = defineEmits(['search', 'reset', 'close'])
16
+
17
+ </script>
18
+ <style scoped lang="scss"></style>
package/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ // import c from './components/index.ts'
2
+ // export default c
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "@elementplus-kit/uikit",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "",
5
5
  "main": "./components/index.ts",
6
- "files": [
7
- "dist/"
8
- ],
9
6
  "peerDependencies": {
10
7
  "@element-plus/icons-vue": "*",
11
8
  "element-plus": "*",
package/vite.config.ts ADDED
@@ -0,0 +1,30 @@
1
+ import { defineConfig } from "vite";
2
+ import vue from "@vitejs/plugin-vue";
3
+ import vueJsx from "@vitejs/plugin-vue-jsx";
4
+ // import dts from 'vite-plugin-dts'
5
+ // import { resolve } from 'path'
6
+
7
+ export default defineConfig({
8
+ plugins: [
9
+ vue(),
10
+ vueJsx(),
11
+ // dts({
12
+ // rollupTypes: false,
13
+ // tsconfigPath: './tsconfig.json',
14
+ // }),
15
+ ],
16
+ build: {
17
+ // 指定打包输出目录名称,替换成你想要的名字
18
+ outDir: "dist",
19
+ lib: {
20
+ entry: "components/index.ts",
21
+ name: "ElementPlusKit",
22
+ fileName: "index",
23
+ // fileName: (format) => `my-utils.${format}.js`,
24
+ },
25
+ rollupOptions: {
26
+ external: ["vue", "element-plus", "lodash-es", "@element-plus/icons-vue"],
27
+ },
28
+ emptyOutDir: true,
29
+ },
30
+ });