ct-component-plus 0.0.39 → 0.0.40
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
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
:min-width="judgeMinWidth(column, index)"
|
|
26
26
|
:sort-orders="['ascending', 'descending']"
|
|
27
27
|
:sortable="column.sortable ? 'custom' : false"
|
|
28
|
-
:align="column
|
|
28
|
+
:align="getColumnAlign(column)"
|
|
29
29
|
:fixed="column.fixed || false"
|
|
30
30
|
show-overflow-tooltip
|
|
31
31
|
v-bind="column.rawAttr || {}">
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
:min-width="judgeMinWidth(column1, index)"
|
|
56
56
|
:sort-orders="['ascending', 'descending']"
|
|
57
57
|
:sortable="column1.sortable ? 'custom' : false"
|
|
58
|
-
:align="column1
|
|
58
|
+
:align="getColumnAlign(column1)"
|
|
59
59
|
:fixed="column1.fixed || false"
|
|
60
60
|
show-overflow-tooltip
|
|
61
61
|
v-bind="column1.rawAttr || {}">
|
|
@@ -137,6 +137,18 @@ const showData = computed(() => {
|
|
|
137
137
|
const columnData = computed(() => {
|
|
138
138
|
return props.tableProps.columnData || [];
|
|
139
139
|
});
|
|
140
|
+
const getColumnAlign = (column) => {
|
|
141
|
+
if (column.align) {
|
|
142
|
+
return column.align;
|
|
143
|
+
}
|
|
144
|
+
if (props.alignLeftKeys && props.alignLeftKeys.includes(column.value)) {
|
|
145
|
+
return "left";
|
|
146
|
+
}
|
|
147
|
+
if (props.alignRightKeys && props.alignRightKeys.includes(column.value)) {
|
|
148
|
+
return "right";
|
|
149
|
+
}
|
|
150
|
+
return "center";
|
|
151
|
+
};
|
|
140
152
|
const judgeWidth = (column, index) => {
|
|
141
153
|
// 判断处理column的width
|
|
142
154
|
const columnWidth = props.columnWidth;
|