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 +71 -2
- package/dist/index.js +688 -0
- package/dist/index.umd.cjs +1 -0
- package/dist/style.css +1 -0
- package/package.json +14 -3
- package/README.assets/image-20210820173738506.png +0 -0
- package/script/link.ts +0 -36
- package/script/unlink.ts +0 -45
- package/src/GeneralBasicForm.vue +0 -246
- package/src/assets/image-20210820173037871.png +0 -0
- package/src/assets/logo.png +0 -0
- package/src/components/VBasic/cascader/index.vue +0 -31
- package/src/components/VBasic/date-picker/index.vue +0 -30
- package/src/components/VBasic/divider/index.vue +0 -52
- package/src/components/VBasic/input/index.vue +0 -67
- package/src/components/VBasic/input-graphic-verification/index.vue +0 -56
- package/src/components/VBasic/input-mobile-verification/index.vue +0 -31
- package/src/components/VBasic/input-mobile-verification/verification-button.vue +0 -64
- package/src/components/VBasic/input-number/index.vue +0 -30
- package/src/components/VBasic/radio/index.vue +0 -40
- package/src/components/VBasic/select/index.vue +0 -37
- package/src/components/setting.ts +0 -28
- package/src/index.ts +0 -15
- package/src/injectKey.ts +0 -2
- package/src/types/basicFrom.ts +0 -53
- package/src/types/componentsProps.ts +0 -17
- package/tsconfig.json +0 -14
- package/vite.config.js +0 -123
- /package/{public → dist}/index.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# GeneralBasicForm
|
|
2
2
|
|
|
3
|
-
一个兼容 Vue3 和 React(未来实现) 的表单组件
|
|
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
|
+

|
|
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
|
+

|
|
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
|