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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "st-comp",
3
3
  "public": true,
4
- "version": "0.0.6",
4
+ "version": "0.0.7",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -1,83 +1,86 @@
1
1
  <template>
2
- <el-table
3
- v-loading="loading"
4
- :data="data"
5
- stripe
6
- style="width: 100%"
7
- @sort-change="sortChange"
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
- <template
19
- v-if="item.type === 'formatter'"
20
- #default="scope"
21
- >
22
- <Formatter
23
- :option="item"
24
- :scope="scope"
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-for="(btn, btnIndex) in item.btns"
42
- :key="`${btn.text}-${btnIndex}`"
20
+ v-if="item.type === 'formatter'"
21
+ #default="scope"
43
22
  >
44
- <el-popover
45
- v-if="btn.children"
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
- </template>
76
- </el-table-column>
77
- </el-table>
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'