@xuekl/cli-components 1.0.7 → 1.0.8
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/XklSelect.vue +15 -1
- package/package.json +1 -1
package/XklSelect.vue
CHANGED
|
@@ -26,9 +26,23 @@ const changeHandle = (val: string) => {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const handleData = (data) => {
|
|
29
|
+
const split = config?.split
|
|
30
|
+
const labelTarget = config?.labelTarget
|
|
31
|
+
let labels = []
|
|
32
|
+
if (split) {
|
|
33
|
+
if (labelTarget) {
|
|
34
|
+
labels = labelTarget.split(split)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
29
38
|
data.forEach(inner => {
|
|
30
39
|
inner.value = inner[config?.valueTarget || 'value']
|
|
31
|
-
|
|
40
|
+
if (!split) {
|
|
41
|
+
inner.label = inner[labelTarget || 'label']
|
|
42
|
+
} else {
|
|
43
|
+
inner.label = labels.map(label => inner[label]).join(split)
|
|
44
|
+
}
|
|
45
|
+
|
|
32
46
|
})
|
|
33
47
|
return data
|
|
34
48
|
}
|