@uf_lee/leeui 1.0.26 → 1.0.27
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/README.md +13 -404
- package/dist/types/types.d.ts +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: 李天惊 uf_lee@163.com
|
|
3
|
+
* @Date: 2025-04-09 12:39:11
|
|
4
|
+
* @LastEditors: 李天惊 uf_lee@163.com
|
|
5
|
+
* @LastEditTime: 2025-04-09 12:58:22
|
|
6
|
+
* @FilePath: \leeui\lee-ui\README.md
|
|
7
|
+
* Copyright (c) 2025 by ${git_name_email}, All Rights Reserved.
|
|
8
|
+
-->
|
|
1
9
|
|
|
2
10
|
# LeeUI
|
|
3
11
|
|
|
@@ -41,409 +49,10 @@ app.use(LeeUI);
|
|
|
41
49
|
app.mount("#app");
|
|
42
50
|
``` -->
|
|
43
51
|
|
|
44
|
-
###
|
|
52
|
+
### 示例及测试代码
|
|
45
53
|
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
import { reactive, ref, onMounted } from "vue";
|
|
49
|
-
import { ElDivider } from "element-plus";
|
|
50
|
-
import { LElForm, LElFormItemCom } from "@uf_lee/leeui";
|
|
51
|
-
import type { FormSchema } from "@uf_lee/leeui/dist/types/types";
|
|
52
|
-
|
|
53
|
-
// --------------------- Autocomplete 使用的一些设置 start -------------------------
|
|
54
|
-
interface RestaurantItem {
|
|
55
|
-
value: string;
|
|
56
|
-
link: string;
|
|
57
|
-
}
|
|
58
|
-
const restaurants = ref<RestaurantItem[]>([]);
|
|
59
|
-
const querySearch = (queryString: string, cb: any) => {
|
|
60
|
-
const results = queryString
|
|
61
|
-
? restaurants.value.filter(createFilter(queryString))
|
|
62
|
-
: restaurants.value;
|
|
63
|
-
// call callback function to return suggestions
|
|
64
|
-
cb(results);
|
|
65
|
-
};
|
|
66
|
-
const createFilter = (queryString: string) => {
|
|
67
|
-
return (restaurant: RestaurantItem) => {
|
|
68
|
-
return (
|
|
69
|
-
restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
|
|
70
|
-
);
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
const loadAll = () => {
|
|
74
|
-
return [
|
|
75
|
-
{ value: "vue", link: "https://github.com/vuejs/vue" },
|
|
76
|
-
{ value: "element", link: "https://github.com/ElemeFE/element" },
|
|
77
|
-
{ value: "cooking", link: "https://github.com/ElemeFE/cooking" },
|
|
78
|
-
{ value: "mint-ui", link: "https://github.com/ElemeFE/mint-ui" },
|
|
79
|
-
{ value: "vuex", link: "https://github.com/vuejs/vuex" },
|
|
80
|
-
{ value: "vue-router", link: "https://github.com/vuejs/vue-router" },
|
|
81
|
-
{ value: "babel", link: "https://github.com/babel/babel" },
|
|
82
|
-
];
|
|
83
|
-
};
|
|
84
|
-
const handleSelect = (item: Record<string, any>) => {
|
|
85
|
-
console.log(item);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
onMounted(() => {
|
|
89
|
-
restaurants.value = loadAll();
|
|
90
|
-
});
|
|
91
|
-
// --------------------- Autocomplete 使用的一些设置 end -------------------------
|
|
92
|
-
|
|
93
|
-
const schema: FormSchema[] = [
|
|
94
|
-
{
|
|
95
|
-
field: "undefined",
|
|
96
|
-
label: "undefined",
|
|
97
|
-
componentProps: {
|
|
98
|
-
placeholder: "默认输入框",
|
|
99
|
-
},
|
|
100
|
-
colProps: {
|
|
101
|
-
span: 24,
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
field: "Radio",
|
|
106
|
-
label: "Radio",
|
|
107
|
-
component: "Radio",
|
|
108
|
-
componentProps: {
|
|
109
|
-
options: [
|
|
110
|
-
{
|
|
111
|
-
label: "选项1",
|
|
112
|
-
value: "1",
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
label: "选项2",
|
|
116
|
-
value: "2",
|
|
117
|
-
},
|
|
118
|
-
],
|
|
119
|
-
},
|
|
120
|
-
colProps: {
|
|
121
|
-
span: 6,
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
field: "RadioButton",
|
|
126
|
-
label: "RadioButton",
|
|
127
|
-
component: "RadioButton",
|
|
128
|
-
componentProps: {
|
|
129
|
-
options: [
|
|
130
|
-
{
|
|
131
|
-
label: "选项1",
|
|
132
|
-
value: "1",
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
label: "选项2",
|
|
136
|
-
value: "2",
|
|
137
|
-
},
|
|
138
|
-
],
|
|
139
|
-
},
|
|
140
|
-
colProps: {
|
|
141
|
-
span: 6,
|
|
142
|
-
},
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
field: "Checkbox",
|
|
146
|
-
label: "Checkbox",
|
|
147
|
-
component: "Checkbox",
|
|
148
|
-
componentProps: {
|
|
149
|
-
options: [
|
|
150
|
-
{
|
|
151
|
-
label: "选项1",
|
|
152
|
-
value: "1",
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
label: "选项2",
|
|
156
|
-
value: "2",
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
},
|
|
160
|
-
colProps: {
|
|
161
|
-
span: 6,
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
field: "CheckboxButton",
|
|
166
|
-
label: "CheckboxButton",
|
|
167
|
-
component: "CheckboxButton",
|
|
168
|
-
componentProps: {
|
|
169
|
-
options: [
|
|
170
|
-
{
|
|
171
|
-
label: "选项1",
|
|
172
|
-
value: "1",
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
label: "选项2",
|
|
176
|
-
value: "2",
|
|
177
|
-
},
|
|
178
|
-
],
|
|
179
|
-
},
|
|
180
|
-
colProps: {
|
|
181
|
-
span: 6,
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
field: "Input",
|
|
186
|
-
label: "Input",
|
|
187
|
-
component: "Input",
|
|
188
|
-
componentProps: {
|
|
189
|
-
placeholder: "输入框",
|
|
190
|
-
},
|
|
191
|
-
colProps: {
|
|
192
|
-
span: 8,
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
field: "Autocomplete",
|
|
197
|
-
label: "Autocomplete",
|
|
198
|
-
component: "Autocomplete",
|
|
199
|
-
componentProps: {
|
|
200
|
-
placeholder: "自动补全输入框",
|
|
201
|
-
fetchSuggestions: querySearch,
|
|
202
|
-
onselect: handleSelect,
|
|
203
|
-
},
|
|
204
|
-
colProps: {
|
|
205
|
-
span: 8,
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
field: "InputNumber",
|
|
210
|
-
label: "InputNumber",
|
|
211
|
-
component: "InputNumber",
|
|
212
|
-
componentProps: {},
|
|
213
|
-
colProps: {
|
|
214
|
-
span: 8,
|
|
215
|
-
},
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
field: "Select",
|
|
219
|
-
label: "Select",
|
|
220
|
-
component: "Select",
|
|
221
|
-
componentProps: {
|
|
222
|
-
placeholder: "请选择下拉框",
|
|
223
|
-
options: [
|
|
224
|
-
{
|
|
225
|
-
label: "选项1",
|
|
226
|
-
value: "1",
|
|
227
|
-
},
|
|
228
|
-
{
|
|
229
|
-
label: "选项2",
|
|
230
|
-
value: "2",
|
|
231
|
-
},
|
|
232
|
-
],
|
|
233
|
-
},
|
|
234
|
-
colProps: {
|
|
235
|
-
span: 10,
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
field: "Cascader",
|
|
240
|
-
label: "Cascader",
|
|
241
|
-
component: "Cascader",
|
|
242
|
-
componentProps: {
|
|
243
|
-
placeholder: "级联选择器",
|
|
244
|
-
options: [
|
|
245
|
-
{
|
|
246
|
-
label: "选项1",
|
|
247
|
-
value: "1",
|
|
248
|
-
children: [
|
|
249
|
-
{
|
|
250
|
-
label: "选项1-1",
|
|
251
|
-
value: "1001",
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
label: "选项1-2",
|
|
255
|
-
value: "1002",
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
label: "选项1-3",
|
|
259
|
-
value: "1003",
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
label: "选项1-4",
|
|
263
|
-
value: "1004",
|
|
264
|
-
},
|
|
265
|
-
],
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
label: "选项2",
|
|
269
|
-
value: "2",
|
|
270
|
-
children: [
|
|
271
|
-
{
|
|
272
|
-
label: "选项2-1",
|
|
273
|
-
value: "2001",
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
label: "选项2-2",
|
|
277
|
-
value: "2002",
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
label: "选项2-3",
|
|
281
|
-
value: "2003",
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
label: "选项2-4",
|
|
285
|
-
value: "2004",
|
|
286
|
-
},
|
|
287
|
-
],
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
label: "选项3",
|
|
291
|
-
value: "3",
|
|
292
|
-
children: [
|
|
293
|
-
{
|
|
294
|
-
label: "选项3-1",
|
|
295
|
-
value: "3001",
|
|
296
|
-
children: [
|
|
297
|
-
{
|
|
298
|
-
label: "选项3-1-1",
|
|
299
|
-
value: "3001001",
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
label: "选项3-1-1",
|
|
303
|
-
value: "3001--2",
|
|
304
|
-
},
|
|
305
|
-
],
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
label: "选项3-2",
|
|
309
|
-
value: "3002",
|
|
310
|
-
},
|
|
311
|
-
],
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
label: "选项4",
|
|
315
|
-
value: "4",
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
label: "选项5",
|
|
319
|
-
value: "5",
|
|
320
|
-
},
|
|
321
|
-
],
|
|
322
|
-
},
|
|
323
|
-
colProps: {
|
|
324
|
-
span: 10,
|
|
325
|
-
},
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
field: "Switch",
|
|
329
|
-
label: "Switch",
|
|
330
|
-
component: "Switch",
|
|
331
|
-
componentProps: {},
|
|
332
|
-
colProps: {
|
|
333
|
-
span: 4,
|
|
334
|
-
},
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
field: "Slider",
|
|
338
|
-
label: "Slider",
|
|
339
|
-
component: "Slider",
|
|
340
|
-
componentProps: {},
|
|
341
|
-
colProps: {
|
|
342
|
-
span: 24,
|
|
343
|
-
},
|
|
344
|
-
},
|
|
345
|
-
{
|
|
346
|
-
field: "TimePicker",
|
|
347
|
-
label: "TimePicker",
|
|
348
|
-
component: "TimePicker",
|
|
349
|
-
componentProps: {},
|
|
350
|
-
colProps: {
|
|
351
|
-
span: 6,
|
|
352
|
-
},
|
|
353
|
-
},
|
|
354
|
-
{
|
|
355
|
-
field: "DatePicker",
|
|
356
|
-
label: "DatePicker",
|
|
357
|
-
component: "DatePicker",
|
|
358
|
-
componentProps: {},
|
|
359
|
-
colProps: {
|
|
360
|
-
span: 6,
|
|
361
|
-
},
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
field: "Rate",
|
|
365
|
-
label: "Rate",
|
|
366
|
-
component: "Rate",
|
|
367
|
-
componentProps: {},
|
|
368
|
-
colProps: {
|
|
369
|
-
span: 6,
|
|
370
|
-
},
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
field: "ColorPicker",
|
|
374
|
-
label: "ColorPicker",
|
|
375
|
-
component: "ColorPicker",
|
|
376
|
-
componentProps: {},
|
|
377
|
-
colProps: {
|
|
378
|
-
span: 6,
|
|
379
|
-
},
|
|
380
|
-
},
|
|
381
|
-
{
|
|
382
|
-
field: "Transfer",
|
|
383
|
-
label: "Transfer",
|
|
384
|
-
component: "Transfer",
|
|
385
|
-
componentProps: {},
|
|
386
|
-
colProps: {
|
|
387
|
-
span: 12,
|
|
388
|
-
},
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
field: "Divider",
|
|
392
|
-
label: "Divider",
|
|
393
|
-
component: "Divider",
|
|
394
|
-
componentProps: {
|
|
395
|
-
contentPosition: "center",
|
|
396
|
-
},
|
|
397
|
-
colProps: {
|
|
398
|
-
span: 12,
|
|
399
|
-
},
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
field: "TimeSelect",
|
|
403
|
-
label: "TimeSelect",
|
|
404
|
-
component: "TimeSelect",
|
|
405
|
-
componentProps: {},
|
|
406
|
-
colProps: {
|
|
407
|
-
span: 12,
|
|
408
|
-
},
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
field: "SelectV2",
|
|
412
|
-
label: "SelectV2",
|
|
413
|
-
component: "SelectV2",
|
|
414
|
-
componentProps: {
|
|
415
|
-
options: [
|
|
416
|
-
{
|
|
417
|
-
label: "选项1",
|
|
418
|
-
value: "1",
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
label: "选项2",
|
|
422
|
-
value: "2",
|
|
423
|
-
},
|
|
424
|
-
],
|
|
425
|
-
},
|
|
426
|
-
colProps: {
|
|
427
|
-
span: 12,
|
|
428
|
-
},
|
|
429
|
-
},
|
|
430
|
-
];
|
|
431
|
-
|
|
432
|
-
// 值
|
|
433
|
-
const model: any = reactive({
|
|
434
|
-
undefined: "12312",
|
|
435
|
-
});
|
|
436
|
-
</script>
|
|
437
|
-
|
|
438
|
-
<template>
|
|
439
|
-
<el-divider content-position="left">model</el-divider>
|
|
440
|
-
{{ model }}
|
|
441
|
-
<el-divider content-position="left">LElForm</el-divider>
|
|
442
|
-
<LElForm :schema="schema" :model="model" />
|
|
443
|
-
<el-divider content-position="left">LElFormItemCom</el-divider>
|
|
444
|
-
<LElFormItemCom :data="schema[0]" v-model="model.undefined" />
|
|
445
|
-
<LElFormItemCom :data="schema[1]" v-model="model[schema[1].field]" />
|
|
446
|
-
</template>
|
|
54
|
+
```bash
|
|
55
|
+
git clone https://gitee.com/uf_lee/lee-ui-test.git
|
|
447
56
|
```
|
|
448
57
|
|
|
449
58
|
## 📖 API 说明
|
|
@@ -466,11 +75,11 @@ const model: any = reactive({
|
|
|
466
75
|
|
|
467
76
|
欢迎贡献代码!请提交 PR 或 Issue 进行讨论。
|
|
468
77
|
|
|
469
|
-
|
|
78
|
+
1. Fork 本仓库。
|
|
470
79
|
2. 创建新分支:`git checkout -b feature-branch`。
|
|
471
80
|
3. 提交更改:`git commit -m 'Add some feature'`。
|
|
472
81
|
4. 推送分支:`git push origin feature-branch`。
|
|
473
|
-
5. 提交 Pull Request。
|
|
82
|
+
5. 提交 Pull Request。
|
|
474
83
|
|
|
475
84
|
## 📜 License
|
|
476
85
|
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FormProps } from "
|
|
2
|
-
import { FormSchema } from "
|
|
3
|
-
import { TableSchema } from "
|
|
4
|
-
import { ComData } from "
|
|
1
|
+
import { FormProps } from "./components/LElForm/src/types";
|
|
2
|
+
import { FormSchema } from "./components/LElForm/src/types";
|
|
3
|
+
import { TableSchema } from "./components/LElTable/src/types";
|
|
4
|
+
import { ComData } from "./components/LElCom/src/types";
|
|
5
5
|
export { FormProps, FormSchema, TableSchema, ComData };
|