@xuekl/cli-components 1.0.9 → 1.1.0
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/XklTable.vue +13 -2
- package/package.json +1 -1
package/XklTable.vue
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-table ref="XklTable" :data="table.list" style="width: 100%" :header-cell-style="{ background: '#F1F4F9' }">
|
|
3
|
-
<el-table-column v-if="table.selection"
|
|
3
|
+
<el-table-column v-if="table.selection" v-bind="table.selectionConfig" type="selection"
|
|
4
|
+
align="center"></el-table-column>
|
|
4
5
|
<el-table-column v-if="table.index" type="index" align="center" v-bind="table.indexConfig"></el-table-column>
|
|
5
6
|
<el-table-column v-for="item in table.columns" :key="item.prop" :prop="item.prop" :label="item.label"
|
|
6
7
|
:width="item.width" :align="item.align || 'center'" :sortable="item.sortable">
|
|
@@ -41,11 +42,12 @@ export default {
|
|
|
41
42
|
</script>
|
|
42
43
|
<script setup lang="ts">
|
|
43
44
|
import http from "@/utils/httpRequest"
|
|
44
|
-
import { computed } from "vue";
|
|
45
|
+
import { computed, ref } from "vue";
|
|
45
46
|
const props = defineProps(['table'])
|
|
46
47
|
const { table } = props
|
|
47
48
|
const dictTypes = table.columns.map(res => res.dict).filter(res => !!res)
|
|
48
49
|
const dictStore = {}
|
|
50
|
+
const XklTable = ref(null)
|
|
49
51
|
|
|
50
52
|
dictTypes.forEach((dict: string) => {
|
|
51
53
|
http({
|
|
@@ -83,4 +85,13 @@ const tagColor = computed(() => {
|
|
|
83
85
|
}
|
|
84
86
|
})
|
|
85
87
|
|
|
88
|
+
const getRef = () => {
|
|
89
|
+
return XklTable.value
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
defineExpose({
|
|
93
|
+
getRef
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
|
|
86
97
|
</script>
|