@tmagic/element-plus-adapter 1.7.0-beta.2 → 1.7.0-beta.4
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/dist/tmagic-element-plus-adapter.js +27 -502
- package/dist/tmagic-element-plus-adapter.umd.cjs +26 -501
- package/package.json +2 -2
- package/src/Table.vue +3 -0
- package/src/index.ts +8 -3
- package/src/FormItem.vue +0 -27
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.7.0-beta.
|
|
2
|
+
"version": "1.7.0-beta.4",
|
|
3
3
|
"name": "@tmagic/element-plus-adapter",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/tmagic-element-plus-adapter.umd.cjs",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"element-plus": ">=2.9.0",
|
|
39
39
|
"typescript": "^5.9.3",
|
|
40
|
-
"@tmagic/design": "1.7.0-beta.
|
|
40
|
+
"@tmagic/design": "1.7.0-beta.4"
|
|
41
41
|
},
|
|
42
42
|
"peerDependenciesMeta": {
|
|
43
43
|
"typescript": {
|
package/src/Table.vue
CHANGED
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
>
|
|
23
23
|
<template v-for="(item, columnIndex) in columns" :key="columnIndex">
|
|
24
24
|
<ElTableColumn v-bind="item.props || {}">
|
|
25
|
+
<template #header="scope" v-if="item.title">
|
|
26
|
+
<component :is="item.title(scope)"></component>
|
|
27
|
+
</template>
|
|
25
28
|
<template #default="scope" v-if="item.cell">
|
|
26
29
|
<component :is="item.cell(scope)"></component>
|
|
27
30
|
</template>
|
package/src/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
ElDropdownItem,
|
|
19
19
|
ElDropdownMenu,
|
|
20
20
|
ElForm,
|
|
21
|
+
ElFormItem,
|
|
21
22
|
ElIcon,
|
|
22
23
|
ElInput,
|
|
23
24
|
ElInputNumber,
|
|
@@ -90,7 +91,6 @@ import type {
|
|
|
90
91
|
UploadProps,
|
|
91
92
|
} from '@tmagic/design';
|
|
92
93
|
|
|
93
|
-
import FormItem from './FormItem.vue';
|
|
94
94
|
import Table from './Table.vue';
|
|
95
95
|
|
|
96
96
|
const adapter: DesignPluginOptions = {
|
|
@@ -111,7 +111,12 @@ const adapter: DesignPluginOptions = {
|
|
|
111
111
|
|
|
112
112
|
button: {
|
|
113
113
|
component: ElButton as any,
|
|
114
|
-
props: (props: ButtonProps) =>
|
|
114
|
+
props: (props: ButtonProps) => {
|
|
115
|
+
return {
|
|
116
|
+
...props,
|
|
117
|
+
type: props.type === 'default' ? '' : props.type,
|
|
118
|
+
};
|
|
119
|
+
},
|
|
115
120
|
},
|
|
116
121
|
|
|
117
122
|
card: {
|
|
@@ -195,7 +200,7 @@ const adapter: DesignPluginOptions = {
|
|
|
195
200
|
},
|
|
196
201
|
|
|
197
202
|
formItem: {
|
|
198
|
-
component:
|
|
203
|
+
component: ElFormItem as any,
|
|
199
204
|
props: (props: FormItemProps) => props,
|
|
200
205
|
},
|
|
201
206
|
|
package/src/FormItem.vue
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ElFormItem v-bind="itemProps">
|
|
3
|
-
<template #label>
|
|
4
|
-
<slot name="label"></slot>
|
|
5
|
-
</template>
|
|
6
|
-
<slot></slot>
|
|
7
|
-
<div v-if="extra" v-html="extra" class="m-form-tip"></div>
|
|
8
|
-
</ElFormItem>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script setup lang="ts">
|
|
12
|
-
import { computed } from 'vue';
|
|
13
|
-
import { ElFormItem } from 'element-plus';
|
|
14
|
-
|
|
15
|
-
import { FormItemProps } from '@tmagic/design';
|
|
16
|
-
|
|
17
|
-
defineOptions({
|
|
18
|
-
name: 'TElAdapterFormItem',
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const props = defineProps<FormItemProps>();
|
|
22
|
-
|
|
23
|
-
const itemProps = computed(() => {
|
|
24
|
-
const { extra, ...rest } = props;
|
|
25
|
-
return rest;
|
|
26
|
-
});
|
|
27
|
-
</script>
|