@xilonglab/vue-main 1.3.18 → 1.3.20

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@xilonglab/vue-main",
3
- "version": "1.3.18",
3
+ "version": "1.3.20",
4
4
  "description": "xilong vue main",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
@@ -18,6 +18,10 @@ const props = defineProps({
18
18
  type: [Array, Object], // Allow both Array and Ref<Array>
19
19
  default: () => [],
20
20
  },
21
+ labels: {
22
+ type: Array,
23
+ default: () => null,
24
+ },
21
25
  disabled: {
22
26
  type: Boolean,
23
27
  default: false,
@@ -53,6 +57,14 @@ const value = computed({
53
57
  });
54
58
 
55
59
  const resolvedOptions = computed(() => {
60
+ // 如果 labels 存在,将其转换为 options 格式
61
+ if (props.labels && props.labels.length > 0) {
62
+ return props.labels.map(label => ({
63
+ label: label,
64
+ value: label,
65
+ }));
66
+ }
67
+ // 否则使用原来的 options
56
68
  return props.options.value ? props.options.value : props.options;
57
69
  });
58
70
  </script>
@@ -130,6 +130,15 @@ const { refs, api, params, obj, chartOptions, total } = inject('injections')
130
130
  :l="col.label"
131
131
  :p="col.prop"
132
132
  />
133
+ <xl-col v-else-if="col.type === 'clamp'"
134
+ :l="col.label"
135
+ :width="col.width"
136
+ v-slot="{ row }"
137
+ >
138
+ <p class="text-left clamp1" :title="row[col.prop]">
139
+ {{ row[col.prop] }}
140
+ </p>
141
+ </xl-col>
133
142
  <xl-map-col
134
143
  v-else-if="col.type === 'map'"
135
144
  :l="col.label"
@@ -194,5 +203,21 @@ const { refs, api, params, obj, chartOptions, total } = inject('injections')
194
203
  padding: 0 !important;
195
204
 
196
205
  }
206
+
207
+ .clamp(@lines) {
208
+ overflow: hidden;
209
+ display: -webkit-box;
210
+ -webkit-line-clamp: @lines;
211
+ -webkit-box-orient: vertical;
212
+ text-align: left;
213
+ }
214
+
215
+ .clamp1 {
216
+ .clamp(1);
217
+ }
218
+
219
+ .text-left {
220
+ text-align: left;
221
+ }
197
222
  }
198
223
  </style>