st-comp 0.0.6 → 0.0.7
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/components.d.ts +1 -0
- package/lib/bundle.js +2398 -2229
- package/lib/bundle.umd.cjs +10 -10
- package/package.json +1 -1
- package/packages/Table/index.vue +72 -69
package/package.json
CHANGED
package/packages/Table/index.vue
CHANGED
|
@@ -1,83 +1,86 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<el-table-column
|
|
10
|
-
v-for="item in columnConfig"
|
|
11
|
-
:key="item.prop"
|
|
12
|
-
:prop="item.prop"
|
|
13
|
-
:label="item.label"
|
|
14
|
-
:sortable="item.sortable"
|
|
15
|
-
:width="item.width"
|
|
16
|
-
:min-width="item.minWidth"
|
|
2
|
+
<el-config-provider :locale="zhCn">
|
|
3
|
+
<el-table
|
|
4
|
+
v-loading="loading"
|
|
5
|
+
:data="data"
|
|
6
|
+
stripe
|
|
7
|
+
style="width: 100%"
|
|
8
|
+
@sort-change="sortChange"
|
|
17
9
|
>
|
|
18
|
-
<
|
|
19
|
-
v-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</template>
|
|
27
|
-
<template
|
|
28
|
-
v-else-if="item.type === 'slot'"
|
|
29
|
-
#default="scope"
|
|
30
|
-
>
|
|
31
|
-
<slot
|
|
32
|
-
:name="item.slot"
|
|
33
|
-
:row="scope.row"
|
|
34
|
-
/>
|
|
35
|
-
</template>
|
|
36
|
-
<template
|
|
37
|
-
v-else-if="item.type === 'btns'"
|
|
38
|
-
#default="scope"
|
|
10
|
+
<el-table-column
|
|
11
|
+
v-for="item in columnConfig"
|
|
12
|
+
:key="item.prop"
|
|
13
|
+
:prop="item.prop"
|
|
14
|
+
:label="item.label"
|
|
15
|
+
:sortable="item.sortable"
|
|
16
|
+
:width="item.width"
|
|
17
|
+
:min-width="item.minWidth"
|
|
39
18
|
>
|
|
40
19
|
<template
|
|
41
|
-
v-
|
|
42
|
-
|
|
20
|
+
v-if="item.type === 'formatter'"
|
|
21
|
+
#default="scope"
|
|
43
22
|
>
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
placement="bottom"
|
|
47
|
-
trigger="hover"
|
|
48
|
-
:popper-style="{ minWidth: '0px', width: null }"
|
|
49
|
-
>
|
|
50
|
-
<template #reference>
|
|
51
|
-
<el-icon
|
|
52
|
-
:style="{ marginLeft: '10px', verticalAlign: '-5px', cursor: 'pointer' }"
|
|
53
|
-
size="20"
|
|
54
|
-
>
|
|
55
|
-
<MoreFilled />
|
|
56
|
-
</el-icon>
|
|
57
|
-
</template>
|
|
58
|
-
<div
|
|
59
|
-
v-for="(subBtn, subBtnIndex) in btn.children"
|
|
60
|
-
:key="`${subBtn.text}-${subBtnIndex}`"
|
|
61
|
-
:style="{ marginTop: subBtnIndex === 0 ? 0 : '10px'}"
|
|
62
|
-
>
|
|
63
|
-
<Button
|
|
64
|
-
:option="subBtn"
|
|
65
|
-
:scope="scope"
|
|
66
|
-
/>
|
|
67
|
-
</div>
|
|
68
|
-
</el-popover>
|
|
69
|
-
<Button
|
|
70
|
-
v-else
|
|
71
|
-
:option="btn"
|
|
23
|
+
<Formatter
|
|
24
|
+
:option="item"
|
|
72
25
|
:scope="scope"
|
|
73
26
|
/>
|
|
74
27
|
</template>
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
28
|
+
<template
|
|
29
|
+
v-else-if="item.type === 'slot'"
|
|
30
|
+
#default="scope"
|
|
31
|
+
>
|
|
32
|
+
<slot
|
|
33
|
+
:name="item.slot"
|
|
34
|
+
:row="scope.row"
|
|
35
|
+
/>
|
|
36
|
+
</template>
|
|
37
|
+
<template
|
|
38
|
+
v-else-if="item.type === 'btns'"
|
|
39
|
+
#default="scope"
|
|
40
|
+
>
|
|
41
|
+
<template
|
|
42
|
+
v-for="(btn, btnIndex) in item.btns"
|
|
43
|
+
:key="`${btn.text}-${btnIndex}`"
|
|
44
|
+
>
|
|
45
|
+
<el-popover
|
|
46
|
+
v-if="btn.children"
|
|
47
|
+
placement="bottom"
|
|
48
|
+
trigger="hover"
|
|
49
|
+
:popper-style="{ minWidth: '0px', width: null }"
|
|
50
|
+
>
|
|
51
|
+
<template #reference>
|
|
52
|
+
<el-icon
|
|
53
|
+
:style="{ marginLeft: '10px', verticalAlign: '-5px', cursor: 'pointer' }"
|
|
54
|
+
size="20"
|
|
55
|
+
>
|
|
56
|
+
<MoreFilled />
|
|
57
|
+
</el-icon>
|
|
58
|
+
</template>
|
|
59
|
+
<div
|
|
60
|
+
v-for="(subBtn, subBtnIndex) in btn.children"
|
|
61
|
+
:key="`${subBtn.text}-${subBtnIndex}`"
|
|
62
|
+
:style="{ marginTop: subBtnIndex === 0 ? 0 : '10px'}"
|
|
63
|
+
>
|
|
64
|
+
<Button
|
|
65
|
+
:option="subBtn"
|
|
66
|
+
:scope="scope"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
</el-popover>
|
|
70
|
+
<Button
|
|
71
|
+
v-else
|
|
72
|
+
:option="btn"
|
|
73
|
+
:scope="scope"
|
|
74
|
+
/>
|
|
75
|
+
</template>
|
|
76
|
+
</template>
|
|
77
|
+
</el-table-column>
|
|
78
|
+
</el-table>
|
|
79
|
+
</el-config-provider>
|
|
78
80
|
</template>
|
|
79
81
|
|
|
80
82
|
<script setup lang="ts">
|
|
83
|
+
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
|
81
84
|
import { computed } from 'vue'
|
|
82
85
|
import { MoreFilled } from '@element-plus/icons-vue'
|
|
83
86
|
import Button from './components/Button/index.vue'
|