qidian-vue-ui 2.7.3 → 2.7.5
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/dist/components/dict/select/index.vue.mjs +5 -2
- package/dist/components/service-select/index.css +1 -1
- package/dist/components/service-select/index.vue.mjs +1 -1
- package/dist/components/service-select/index.vue2.mjs +4 -1
- package/dist/hooks/useDict/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -239,8 +239,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
239
239
|
}
|
|
240
240
|
function setDefaultSelectFirst(data) {
|
|
241
241
|
if (!hasAutoSelected && reProps.value.defaultSelectFirst && isEmpty(reModelValue.value) && data.length) {
|
|
242
|
-
const
|
|
243
|
-
const
|
|
242
|
+
const { keys, multiple, valueType } = reProps.value.selectOptions;
|
|
243
|
+
const firstOption = data.find(
|
|
244
|
+
(option) => !option[keys?.disabled || "disabled"]
|
|
245
|
+
);
|
|
246
|
+
if (!firstOption) return;
|
|
244
247
|
const firstValue = valueType === "object" ? firstOption : firstOption.value;
|
|
245
248
|
const value = multiple ? [firstValue] : firstValue;
|
|
246
249
|
reModelValue.value = value;
|
|
@@ -4,7 +4,7 @@ import _sfc_main from "./index.vue2.mjs";
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
7
|
-
const QdServiceSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
7
|
+
const QdServiceSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-676b5752"]]);
|
|
8
8
|
export {
|
|
9
9
|
QdServiceSelect as default
|
|
10
10
|
};
|
|
@@ -404,8 +404,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
404
404
|
}
|
|
405
405
|
function setDefaultSelectFirst(data2) {
|
|
406
406
|
if (!hasAutoSelected && reProps.value.defaultSelectFirst && isEmpty(reModelValue.value) && data2.length) {
|
|
407
|
-
const firstOption = data2[0];
|
|
408
407
|
const { keys, multiple, valueType } = reProps.value.selectOptions;
|
|
408
|
+
const firstOption = data2.find(
|
|
409
|
+
(option) => !option[keys?.disabled || qdServiceSelectKeys.disabled]
|
|
410
|
+
);
|
|
411
|
+
if (!firstOption) return;
|
|
409
412
|
const firstValue = valueType === "object" ? firstOption : firstOption[keys?.value || qdServiceSelectKeys.value];
|
|
410
413
|
reModelValue.value = multiple ? [firstValue] : firstValue;
|
|
411
414
|
unWatchAutoSelected?.();
|