general-basic-form 2.0.11 → 2.0.13

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # GeneralBasicForm
2
2
 
3
- 一个兼容 Vue3 和 React(未来实现) 的表单组件 <br/>
3
+ ## 一个兼容 Vue3 和 React(未来实现) 的表单组件
4
4
 
5
5
  示例:
6
6
 
@@ -394,5 +394,74 @@ getList会传出默认的参数,首次请求时会有页数和分页大小,重
394
394
 
395
395
  'input-number' = 'input-number',
396
396
 
397
+
398
+
399
+ ## 对虚拟滚动列表+接口的封装
400
+
401
+
402
+
403
+ ![image-20231208165229296](https://raw.githubusercontent.com/Alan1034/PicturesServer/main/PicGo_imgs/202312081652392.png)
404
+
405
+ ```
406
+ import { VInfiniteScrollList } from 'general-basic-form'
407
+ <VInfiniteScrollList
408
+ :search="search"
409
+ id="user_id"
410
+ name="name"
411
+ ref="InfiniteScrollListRef"
412
+ :extra="extraRender"
413
+ :max="1"
414
+ />
415
+ ```
416
+
417
+ ```
418
+ search:数据接口 (page: Number) => Promise<[]>
419
+ id:数据key值(唯一和选择值)
420
+ name:显示名字
421
+ extra:同行额外显示的内容,(item: any) => Node|String
422
+ ```
423
+
424
+ ```
425
+ defineExpose({ reset, loadList, selectInfo });
426
+ InfiniteScrollListRef.value.reset():重置列表内容
427
+ InfiniteScrollListRef.value.loadList():重新请求列表内容
428
+ InfiniteScrollListRef?.value?.selectInfo:选择的内容
429
+ ```
430
+
431
+ ## 对展示描述列表的封装
432
+
433
+ ![image-20231208182455415](https://raw.githubusercontent.com/Alan1034/PicturesServer/main/PicGo_imgs/202312081824708.png)
434
+
435
+ ```
436
+ import { VDescriptions } from 'general-basic-form'
437
+ <VDescriptions
438
+ :formData="props.formData"
439
+ :formItem="formItem"
440
+ :descriptionsItemProps="{
441
+ 'label-class-name': 'label-class-name'
442
+ }"
443
+ ...其他el-descriptions的配置
444
+ />
445
+ ```
446
+
447
+ ```
448
+ formData:Object
449
+ formItem:[ {
450
+ label: '受访人',
451
+ prop: 'contactors',
452
+ render: (scope: any) => {
453
+ const { $index, row = {} } = scope
454
+ const { contactors = [] } = row
455
+ const ele = (contactors.length > 0 ? <span>{contactors.map((item: any) => item.name).join(",")} </span> : null)
456
+ return ele
457
+ }
458
+ },
459
+ {
460
+ label: '拜访详情',
461
+ prop: 'detail',
462
+ }]
463
+ descriptionsItemProps:el-descriptions-item的配置
464
+ ```
465
+
397
466
  安装:npm i general-basic-form<br/>
398
- install: npm i general-basic-form
467
+ install: npm i general-basic-form