el-plus-crud 0.0.39 → 0.0.41

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 (73) hide show
  1. package/.eslintrc.js +78 -78
  2. package/.prettierrc.js +39 -39
  3. package/CHANGELOG.md +5 -1
  4. package/build.js +31 -31
  5. package/dist/el-plus-crud.mjs +1803 -1801
  6. package/dist/el-plus-crud.umd.js +7 -7
  7. package/dist/style.css +1 -1
  8. package/example/App.vue +67 -67
  9. package/example/main.js +18 -18
  10. package/index.html +13 -13
  11. package/lib/components/el-plus-form/ElPlusForm.vue +771 -774
  12. package/lib/components/el-plus-form/ElPlusFormDialog.vue +90 -90
  13. package/lib/components/el-plus-form/ElPlusFormGroup.vue +116 -116
  14. package/lib/components/el-plus-form/components/ElPlusFormArea.vue +61 -61
  15. package/lib/components/el-plus-form/components/ElPlusFormAutocomplete.vue +49 -49
  16. package/lib/components/el-plus-form/components/ElPlusFormBtn.vue +102 -102
  17. package/lib/components/el-plus-form/components/ElPlusFormBtns.vue +133 -133
  18. package/lib/components/el-plus-form/components/ElPlusFormCascader.vue +63 -63
  19. package/lib/components/el-plus-form/components/ElPlusFormCascaderPanel.vue +53 -53
  20. package/lib/components/el-plus-form/components/ElPlusFormCheckbox.vue +44 -44
  21. package/lib/components/el-plus-form/components/ElPlusFormCheckboxButton.vue +44 -44
  22. package/lib/components/el-plus-form/components/ElPlusFormColor.vue +38 -38
  23. package/lib/components/el-plus-form/components/ElPlusFormDate.vue +39 -39
  24. package/lib/components/el-plus-form/components/ElPlusFormDaterange.vue +46 -46
  25. package/lib/components/el-plus-form/components/ElPlusFormDatetime.vue +40 -40
  26. package/lib/components/el-plus-form/components/ElPlusFormFile.vue +47 -47
  27. package/lib/components/el-plus-form/components/ElPlusFormImage.vue +113 -113
  28. package/lib/components/el-plus-form/components/ElPlusFormLink.vue +281 -281
  29. package/lib/components/el-plus-form/components/ElPlusFormLkuser.vue +489 -489
  30. package/lib/components/el-plus-form/components/ElPlusFormNbinput.vue +53 -53
  31. package/lib/components/el-plus-form/components/ElPlusFormNumber.vue +146 -146
  32. package/lib/components/el-plus-form/components/ElPlusFormQuickInput.vue +94 -94
  33. package/lib/components/el-plus-form/components/ElPlusFormRadio.vue +42 -42
  34. package/lib/components/el-plus-form/components/ElPlusFormRate.vue +38 -38
  35. package/lib/components/el-plus-form/components/ElPlusFormSelect.vue +161 -161
  36. package/lib/components/el-plus-form/components/ElPlusFormSlider.vue +38 -38
  37. package/lib/components/el-plus-form/components/ElPlusFormSwitch.vue +38 -38
  38. package/lib/components/el-plus-form/components/ElPlusFormTag.vue +78 -78
  39. package/lib/components/el-plus-form/components/ElPlusFormText.vue +99 -99
  40. package/lib/components/el-plus-form/components/ElPlusFormTextarea.vue +49 -49
  41. package/lib/components/el-plus-form/components/ElPlusFormTransfer.vue +44 -44
  42. package/lib/components/el-plus-form/components/ElPlusFormTree.vue +76 -76
  43. package/lib/components/el-plus-form/components/ElPlusFormTreeSelect.vue +59 -59
  44. package/lib/components/el-plus-form/components/ElPlusFormUpload.vue +368 -368
  45. package/lib/components/el-plus-form/components/components/file-icons/FileIcons.vue +135 -135
  46. package/lib/components/el-plus-form/components/components/file-icons/data/index.ts +27 -27
  47. package/lib/components/el-plus-form/components/components/file-icons/images/doc.svg +12 -12
  48. package/lib/components/el-plus-form/components/components/file-icons/images/file.svg +18 -18
  49. package/lib/components/el-plus-form/components/components/file-icons/images/jpg.svg +13 -13
  50. package/lib/components/el-plus-form/components/components/file-icons/images/pdf.svg +12 -12
  51. package/lib/components/el-plus-form/components/components/file-icons/images/png.svg +12 -12
  52. package/lib/components/el-plus-form/components/components/file-icons/images/ppt.svg +12 -12
  53. package/lib/components/el-plus-form/components/components/file-icons/images/xls.svg +12 -12
  54. package/lib/components/el-plus-form/components/index.ts +17 -17
  55. package/lib/components/el-plus-form/data/file.ts +74 -74
  56. package/lib/components/el-plus-form/mixins/index.ts +115 -113
  57. package/lib/components/el-plus-form/util/index.ts +257 -257
  58. package/lib/components/el-plus-form/util/validate.ts +332 -332
  59. package/lib/components/el-plus-table/components/columnItem.vue +205 -205
  60. package/lib/components/el-plus-table/components/header.vue +240 -240
  61. package/lib/components/el-plus-table/components/statisticInfo.vue +47 -47
  62. package/lib/components/el-plus-table/util/index.ts +147 -147
  63. package/lib/config/index.ts +30 -30
  64. package/lib/index.d.ts +4 -4
  65. package/lib/index.ts +51 -51
  66. package/package.json +1 -1
  67. package/types/axios.d.ts +13 -13
  68. package/types/formList.d.ts +440 -440
  69. package/types/layout.d.ts +57 -57
  70. package/types/mitt.d.ts +38 -38
  71. package/types/pinia.d.ts +149 -149
  72. package/types/views.d.ts +329 -329
  73. package/vite.config.ts +78 -78
@@ -1,78 +1,78 @@
1
- <template>
2
- <div>
3
- <el-tag v-bind="attrs" :size="attrs.size || 'small'" :type="tagType !== '--' ? tagType : ''" v-on="onEvents">
4
- {{ formatValue || modelValue }}
5
- </el-tag>
6
- </div>
7
- </template>
8
- <script lang="ts">
9
- export default {
10
- name: 'ElPlusFormTag',
11
- inheritAttrs: false,
12
- typeName: 'tag',
13
- customOptions: {}
14
- }
15
- </script>
16
- <script lang="ts" setup>
17
- import { ref, watch, useAttrs, onBeforeMount, inject } from 'vue'
18
- import { getAttrs, getEvents } from '../mixins'
19
-
20
- const format = inject('format') as any
21
-
22
- const props = defineProps<{
23
- modelValue?: string | number | '' | null
24
- field: string
25
- loading?: boolean
26
- desc: { [key: string]: any }
27
- formData: { [key: string]: any }
28
- }>()
29
-
30
- const attrs = ref({} as any)
31
- const onEvents = ref(getEvents(props))
32
-
33
- const formatValue = ref('' as any)
34
- // 格式化Type类型
35
- const tagType = ref('' as any)
36
-
37
- onBeforeMount(async () => {
38
- attrs.value = await getAttrs(props, { ...useAttrs() })
39
- })
40
-
41
- watch(
42
- () => props.modelValue,
43
- async () => {
44
- if (!props.desc.tagType) {
45
- tagType.value = ''
46
- } else {
47
- if (typeof props.desc.tagType === 'function') {
48
- // 如果有方法类型的判断,则需要启用动态监测
49
- tagType.value = await props.desc.tagType(props.modelValue, props.formData, props.field)
50
- } else if (typeof props.desc.tagType === 'string') {
51
- tagType.value = (await format)[props.desc.tagType](props.modelValue, props.formData, props.field)
52
- } else {
53
- tagType.value = ''
54
- }
55
- }
56
- },
57
- { immediate: true }
58
- )
59
-
60
- watch(
61
- () => props.modelValue,
62
- async () => {
63
- if (!props.desc.format) {
64
- formatValue.value = props.modelValue === '' ? '—' : props.modelValue ?? '—'
65
- } else {
66
- if (typeof props.desc.format === 'function') {
67
- // 如果有方法类型的判断,则需要启用动态监测
68
- formatValue.value = await props.desc.format(props.modelValue, props.formData, props.field)
69
- } else if (typeof props.desc.format === 'string') {
70
- formatValue.value = (await format)[props.desc.format](props.modelValue, props.formData, props.field)
71
- } else {
72
- formatValue.value = props.modelValue || '—'
73
- }
74
- }
75
- },
76
- { immediate: true }
77
- )
78
- </script>
1
+ <template>
2
+ <div>
3
+ <el-tag v-bind="attrs" :size="attrs.size || 'small'" :type="tagType !== '--' ? tagType : ''" v-on="onEvents">
4
+ {{ formatValue || modelValue }}
5
+ </el-tag>
6
+ </div>
7
+ </template>
8
+ <script lang="ts">
9
+ export default {
10
+ name: 'ElPlusFormTag',
11
+ inheritAttrs: false,
12
+ typeName: 'tag',
13
+ customOptions: {}
14
+ }
15
+ </script>
16
+ <script lang="ts" setup>
17
+ import { ref, watch, useAttrs, onBeforeMount, inject } from 'vue'
18
+ import { getAttrs, getEvents } from '../mixins'
19
+
20
+ const format = inject('format') as any
21
+
22
+ const props = defineProps<{
23
+ modelValue?: string | number | '' | null
24
+ field: string
25
+ loading?: boolean
26
+ desc: { [key: string]: any }
27
+ formData: { [key: string]: any }
28
+ }>()
29
+
30
+ const attrs = ref({} as any)
31
+ const onEvents = ref(getEvents(props))
32
+
33
+ const formatValue = ref('' as any)
34
+ // 格式化Type类型
35
+ const tagType = ref('' as any)
36
+
37
+ onBeforeMount(async () => {
38
+ attrs.value = await getAttrs(props, { ...useAttrs() })
39
+ })
40
+
41
+ watch(
42
+ () => props.modelValue,
43
+ async () => {
44
+ if (!props.desc.tagType) {
45
+ tagType.value = ''
46
+ } else {
47
+ if (typeof props.desc.tagType === 'function') {
48
+ // 如果有方法类型的判断,则需要启用动态监测
49
+ tagType.value = await props.desc.tagType(props.modelValue, props.formData, props.field)
50
+ } else if (typeof props.desc.tagType === 'string') {
51
+ tagType.value = (await format)[props.desc.tagType](props.modelValue, props.formData, props.field)
52
+ } else {
53
+ tagType.value = ''
54
+ }
55
+ }
56
+ },
57
+ { immediate: true }
58
+ )
59
+
60
+ watch(
61
+ () => props.modelValue,
62
+ async () => {
63
+ if (!props.desc.format) {
64
+ formatValue.value = props.modelValue === '' ? '—' : props.modelValue ?? '—'
65
+ } else {
66
+ if (typeof props.desc.format === 'function') {
67
+ // 如果有方法类型的判断,则需要启用动态监测
68
+ formatValue.value = await props.desc.format(props.modelValue, props.formData, props.field)
69
+ } else if (typeof props.desc.format === 'string') {
70
+ formatValue.value = (await format)[props.desc.format](props.modelValue, props.formData, props.field)
71
+ } else {
72
+ formatValue.value = props.modelValue || '—'
73
+ }
74
+ }
75
+ },
76
+ { immediate: true }
77
+ )
78
+ </script>
@@ -1,99 +1,99 @@
1
- <template>
2
- <div class="ele-form-text" :class="[...(desc.class || []), desc.linkType ? 'ele-form-text-click' : '']" :style="desc.style" v-bind="attrs" v-on="onEvents">
3
- <span v-if="desc.title">{{ desc.title + ': ' }}</span>
4
- <i v-if="desc.icon" :class="[formData.icon]"></i>
5
- {{ formatValue }}
6
- </div>
7
- </template>
8
- <script lang="ts">
9
- export default {
10
- name: 'ElPlusFormText',
11
- inheritAttrs: false,
12
- typeName: 'text',
13
- customOptions: {}
14
- }
15
- </script>
16
- <script lang="ts" setup>
17
- import { ref, watch, computed, onBeforeMount, useAttrs, inject } from 'vue'
18
- import { getEvents, getAttrs } from '../mixins'
19
-
20
- const showInfo = inject('showInfo') as Function
21
- const format = inject('format') as any
22
-
23
- const props = defineProps<{
24
- modelValue?: any
25
- field: string
26
- loading?: boolean
27
- desc: { [key: string]: any }
28
- formData: { [key: string]: any }
29
- }>()
30
-
31
- const attrs = ref({} as any)
32
-
33
- const onEvents = computed(() => {
34
- const tempOn = getEvents(props)
35
-
36
- // 如果这里有linkType,则会替换点击事件
37
- let linkId = props.desc.linkId || 'id'
38
- if (typeof linkId === 'function') {
39
- linkId = linkId(props.modelValue, props.formData)
40
- } else {
41
- linkId = props.formData[linkId]
42
- }
43
- if (props.desc.linkType && linkId) {
44
- let linkType = props.desc.linkType
45
- let linkLabel = props.desc.linkLabel || ''
46
- if (typeof linkType === 'function') {
47
- linkType = linkType(props.modelValue, props.formData)
48
- }
49
- if (typeof linkLabel === 'function') {
50
- linkLabel = linkLabel(props.modelValue, props.formData)
51
- } else {
52
- linkLabel = props.formData[linkLabel]
53
- }
54
- tempOn.click = () => {
55
- // 显示详情
56
- showInfo(linkId, linkType, linkLabel, props.formData)
57
- }
58
- }
59
- return tempOn
60
- })
61
-
62
- const formatValue = ref('' as any)
63
-
64
- onBeforeMount(async () => {
65
- attrs.value = await getAttrs(props, useAttrs())
66
- })
67
-
68
- watch(
69
- () => props.modelValue,
70
- async () => {
71
- if (!props.desc.format) {
72
- formatValue.value = props.modelValue === '' ? props.desc.default ?? '—' : props.modelValue ?? props.desc.default ?? '—'
73
- } else {
74
- if (typeof props.desc.format === 'function') {
75
- // 如果有方法类型的判断,则需要启用动态监测
76
- formatValue.value = await props.desc.format(props.modelValue, props.formData, props.field)
77
- } else if (typeof props.desc.format === 'string') {
78
- formatValue.value = format[props.desc.format] ? format[props.desc.format](props.modelValue, props.formData, props.field) : '--'
79
- } else {
80
- formatValue.value = props.modelValue || '—'
81
- }
82
- }
83
- },
84
- { immediate: true }
85
- )
86
- </script>
87
- <style lang="scss" scoped>
88
- .ele-form-text {
89
- color: #606266;
90
- word-break: break-all;
91
- display: flex;
92
- align-items: center;
93
- }
94
-
95
- .ele-form-text-click {
96
- color: var(--el-color-primary);
97
- cursor: pointer;
98
- }
99
- </style>
1
+ <template>
2
+ <div class="ele-form-text" :class="[...(desc.class || []), desc.linkType ? 'ele-form-text-click' : '']" :style="desc.style" v-bind="attrs" v-on="onEvents">
3
+ <span v-if="desc.title">{{ desc.title + ': ' }}</span>
4
+ <i v-if="desc.icon" :class="[formData.icon]"></i>
5
+ {{ formatValue }}
6
+ </div>
7
+ </template>
8
+ <script lang="ts">
9
+ export default {
10
+ name: 'ElPlusFormText',
11
+ inheritAttrs: false,
12
+ typeName: 'text',
13
+ customOptions: {}
14
+ }
15
+ </script>
16
+ <script lang="ts" setup>
17
+ import { ref, watch, computed, onBeforeMount, useAttrs, inject } from 'vue'
18
+ import { getEvents, getAttrs } from '../mixins'
19
+
20
+ const showInfo = inject('showInfo') as Function
21
+ const format = inject('format') as any
22
+
23
+ const props = defineProps<{
24
+ modelValue?: any
25
+ field: string
26
+ loading?: boolean
27
+ desc: { [key: string]: any }
28
+ formData: { [key: string]: any }
29
+ }>()
30
+
31
+ const attrs = ref({} as any)
32
+
33
+ const onEvents = computed(() => {
34
+ const tempOn = getEvents(props)
35
+
36
+ // 如果这里有linkType,则会替换点击事件
37
+ let linkId = props.desc.linkId || 'id'
38
+ if (typeof linkId === 'function') {
39
+ linkId = linkId(props.modelValue, props.formData)
40
+ } else {
41
+ linkId = props.formData[linkId]
42
+ }
43
+ if (props.desc.linkType && linkId) {
44
+ let linkType = props.desc.linkType
45
+ let linkLabel = props.desc.linkLabel || ''
46
+ if (typeof linkType === 'function') {
47
+ linkType = linkType(props.modelValue, props.formData)
48
+ }
49
+ if (typeof linkLabel === 'function') {
50
+ linkLabel = linkLabel(props.modelValue, props.formData)
51
+ } else {
52
+ linkLabel = props.formData[linkLabel]
53
+ }
54
+ tempOn.click = () => {
55
+ // 显示详情
56
+ showInfo(linkId, linkType, linkLabel, props.formData)
57
+ }
58
+ }
59
+ return tempOn
60
+ })
61
+
62
+ const formatValue = ref('' as any)
63
+
64
+ onBeforeMount(async () => {
65
+ attrs.value = await getAttrs(props, useAttrs())
66
+ })
67
+
68
+ watch(
69
+ () => props.modelValue,
70
+ async () => {
71
+ if (!props.desc.format) {
72
+ formatValue.value = props.modelValue === '' ? props.desc.default ?? '—' : props.modelValue ?? props.desc.default ?? '—'
73
+ } else {
74
+ if (typeof props.desc.format === 'function') {
75
+ // 如果有方法类型的判断,则需要启用动态监测
76
+ formatValue.value = await props.desc.format(props.modelValue, props.formData, props.field)
77
+ } else if (typeof props.desc.format === 'string') {
78
+ formatValue.value = format[props.desc.format] ? format[props.desc.format](props.modelValue, props.formData, props.field) : '--'
79
+ } else {
80
+ formatValue.value = props.modelValue || '—'
81
+ }
82
+ }
83
+ },
84
+ { immediate: true }
85
+ )
86
+ </script>
87
+ <style lang="scss" scoped>
88
+ .ele-form-text {
89
+ color: #606266;
90
+ word-break: break-all;
91
+ display: flex;
92
+ align-items: center;
93
+ }
94
+
95
+ .ele-form-text-click {
96
+ color: var(--el-color-primary);
97
+ cursor: pointer;
98
+ }
99
+ </style>
@@ -1,49 +1,49 @@
1
- <template>
2
- <el-input v-if="isInit" :class="desc.class" :style="desc.style" type="textarea" v-bind="attrs" v-model="currentValue" v-on="onEvents"> </el-input>
3
- </template>
4
- <script lang="ts">
5
- export default {
6
- name: 'ElPlusFormTextarea',
7
- inheritAttrs: false,
8
- typeName: 'textarea',
9
- customOptions: {}
10
- }
11
- </script>
12
- <script lang="ts" setup>
13
- import { ref, useAttrs, watch, onBeforeMount, inject } from 'vue'
14
- import { getAttrs, getEvents } from '../mixins'
15
-
16
- const defaultConf = inject('defaultConf') as ICRUDConfig
17
-
18
- const props = defineProps<{
19
- modelValue?: string | null
20
- field: string
21
- loading?: boolean
22
- desc: { [key: string]: any }
23
- formData: { [key: string]: any }
24
- }>()
25
- const emits = defineEmits(['update:modelValue', 'validateThis'])
26
- const attrs = ref({} as any)
27
- const isInit = ref(false)
28
- const onEvents = ref(getEvents(props))
29
-
30
- const currentValue = ref(props.modelValue)
31
- emits('update:modelValue', currentValue)
32
-
33
- onBeforeMount(async () => {
34
- attrs.value = await getAttrs(props, { maxlength: defaultConf.form?.leng.textare, showWordLimit: true, rows: 3, ...useAttrs() })
35
- isInit.value = true
36
- })
37
-
38
- watch(
39
- () => props.modelValue,
40
- (data: string | null | undefined) => {
41
- // 这里要截取一下字符串长度
42
- if (data && data.length > attrs.value.maxlength) {
43
- data = data.substring(0, attrs.value.maxlength)
44
- }
45
- currentValue.value = data
46
- },
47
- { immediate: true }
48
- )
49
- </script>
1
+ <template>
2
+ <el-input v-if="isInit" :class="desc.class" :style="desc.style" type="textarea" v-bind="attrs" v-model="currentValue" v-on="onEvents"> </el-input>
3
+ </template>
4
+ <script lang="ts">
5
+ export default {
6
+ name: 'ElPlusFormTextarea',
7
+ inheritAttrs: false,
8
+ typeName: 'textarea',
9
+ customOptions: {}
10
+ }
11
+ </script>
12
+ <script lang="ts" setup>
13
+ import { ref, useAttrs, watch, onBeforeMount, inject } from 'vue'
14
+ import { getAttrs, getEvents } from '../mixins'
15
+
16
+ const defaultConf = inject('defaultConf') as ICRUDConfig
17
+
18
+ const props = defineProps<{
19
+ modelValue?: string | null
20
+ field: string
21
+ loading?: boolean
22
+ desc: { [key: string]: any }
23
+ formData: { [key: string]: any }
24
+ }>()
25
+ const emits = defineEmits(['update:modelValue', 'validateThis'])
26
+ const attrs = ref({} as any)
27
+ const isInit = ref(false)
28
+ const onEvents = ref(getEvents(props))
29
+
30
+ const currentValue = ref(props.modelValue)
31
+ emits('update:modelValue', currentValue)
32
+
33
+ onBeforeMount(async () => {
34
+ attrs.value = await getAttrs(props, { maxlength: defaultConf.form?.leng.textare, showWordLimit: true, rows: 3, ...useAttrs() })
35
+ isInit.value = true
36
+ })
37
+
38
+ watch(
39
+ () => props.modelValue,
40
+ (data: string | null | undefined) => {
41
+ // 这里要截取一下字符串长度
42
+ if (data && data.length > attrs.value.maxlength) {
43
+ data = data.substring(0, attrs.value.maxlength)
44
+ }
45
+ currentValue.value = data
46
+ },
47
+ { immediate: true }
48
+ )
49
+ </script>
@@ -1,44 +1,44 @@
1
- <template>
2
- <el-transfer :class="desc.class" :data="desc.options" :style="desc.style" class="ele-form-transfer" v-bind="attrs" v-model="currentValue" v-on="onEvents">
3
- <!-- 非作用域插槽 -->
4
- <template v-for="(item, key, index) in slots" #[key]="data" :key="index">
5
- <slot :name="key" :data="data" />
6
- </template>
7
- </el-transfer>
8
- </template>
9
- <script lang="ts">
10
- export default {
11
- name: 'ElPlusFormTransfer',
12
- inheritAttrs: false,
13
- typeName: 'transfer',
14
- customOptions: {}
15
- }
16
- </script>
17
- <script lang="ts" setup>
18
- import { ref, useAttrs, useSlots, onBeforeMount } from 'vue'
19
- import { getAttrs, getEvents } from '../mixins'
20
-
21
- const props = defineProps<{
22
- modelValue?: string | number | '' | null
23
- field: string
24
- loading?: boolean
25
- desc: { [key: string]: any }
26
- formData: { [key: string]: any }
27
- }>()
28
- const emits = defineEmits(['update:modelValue'])
29
- const currentValue = ref(props.modelValue)
30
- emits('update:modelValue', currentValue)
31
-
32
- const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
33
- const attrs = ref({} as any)
34
- const onEvents = ref(getEvents(props))
35
-
36
- onBeforeMount(async () => {
37
- attrs.value = await getAttrs(props, { ...useAttrs() })
38
- })
39
- </script>
40
- <style lang="scss" scoped>
41
- .ele-form-transfer {
42
- line-height: 1;
43
- }
44
- </style>
1
+ <template>
2
+ <el-transfer :class="desc.class" :data="desc.options" :style="desc.style" class="ele-form-transfer" v-bind="attrs" v-model="currentValue" v-on="onEvents">
3
+ <!-- 非作用域插槽 -->
4
+ <template v-for="(item, key, index) in slots" #[key]="data" :key="index">
5
+ <slot :name="key" :data="data" />
6
+ </template>
7
+ </el-transfer>
8
+ </template>
9
+ <script lang="ts">
10
+ export default {
11
+ name: 'ElPlusFormTransfer',
12
+ inheritAttrs: false,
13
+ typeName: 'transfer',
14
+ customOptions: {}
15
+ }
16
+ </script>
17
+ <script lang="ts" setup>
18
+ import { ref, useAttrs, useSlots, onBeforeMount } from 'vue'
19
+ import { getAttrs, getEvents } from '../mixins'
20
+
21
+ const props = defineProps<{
22
+ modelValue?: string | number | '' | null
23
+ field: string
24
+ loading?: boolean
25
+ desc: { [key: string]: any }
26
+ formData: { [key: string]: any }
27
+ }>()
28
+ const emits = defineEmits(['update:modelValue'])
29
+ const currentValue = ref(props.modelValue)
30
+ emits('update:modelValue', currentValue)
31
+
32
+ const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
33
+ const attrs = ref({} as any)
34
+ const onEvents = ref(getEvents(props))
35
+
36
+ onBeforeMount(async () => {
37
+ attrs.value = await getAttrs(props, { ...useAttrs() })
38
+ })
39
+ </script>
40
+ <style lang="scss" scoped>
41
+ .ele-form-transfer {
42
+ line-height: 1;
43
+ }
44
+ </style>