cnhis-design-vue 3.1.8-beta.3 → 3.1.8-beta.4

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.
@@ -82,14 +82,6 @@ const script = defineComponent({
82
82
  }, {
83
83
  immediate: true
84
84
  });
85
- function updateValue(v, _, options) {
86
- const _option = Array.isArray(options) ? options.map((option) => ({
87
- ...option,
88
- children: void 0
89
- })) : options;
90
- const payload = JSON.stringify(_option);
91
- emit("update:value", payload);
92
- }
93
85
  const labelKey = computed(() => {
94
86
  var _a, _b;
95
87
  return (_b = (_a = props.urlConfig) == null ? void 0 : _a.nameKey) != null ? _b : "text";
@@ -107,7 +99,7 @@ const script = defineComponent({
107
99
  });
108
100
  const _value = computed(() => {
109
101
  try {
110
- const parsed = JSON.parse(attrs.value || "");
102
+ const parsed = Array.isArray(attrs.value) ? attrs.value : JSON.parse(attrs.value || "");
111
103
  if (Array.isArray(parsed)) {
112
104
  return parsed.map((option) => option[labelKey.value]).join(" / ");
113
105
  }
@@ -115,6 +107,14 @@ const script = defineComponent({
115
107
  return "";
116
108
  }
117
109
  });
110
+ function updateValue(v, _, options) {
111
+ const payload = Array.isArray(options) ? options.map((option) => ({
112
+ ...option,
113
+ label: option[labelKey.value],
114
+ children: void 0
115
+ })) : options;
116
+ emit("update:value", payload);
117
+ }
118
118
  return () => {
119
119
  return createVNode(Fragment, null, [createVNode(NCascader, mergeProps(_attrs.value, {
120
120
  "value": _value.value,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
3
  "private": false,
4
- "version": "3.1.8-beta.3",
4
+ "version": "3.1.8-beta.4",
5
5
  "license": "ISC",
6
6
  "module": "es/packages/index.mjs",
7
7
  "main": "es/packages/index.mjs",