qidian-vue-ui 2.7.3 → 2.7.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.
@@ -239,7 +239,8 @@ 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 firstOption = data[0];
242
+ const firstOption = data.find((option) => !option.disabled);
243
+ if (!firstOption) return;
243
244
  const { multiple, valueType } = reProps.value.selectOptions;
244
245
  const firstValue = valueType === "object" ? firstOption : firstOption.value;
245
246
  const value = multiple ? [firstValue] : firstValue;
@@ -1,4 +1,4 @@
1
- .qd-service-select__load[data-v-5d80d43f] {
1
+ .qd-service-select__load[data-v-893f4675] {
2
2
  width: 100%;
3
3
  border-top: 1px solid var(--td-component-stroke);
4
4
  padding: 6px;
@@ -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-5d80d43f"]]);
7
+ const QdServiceSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-893f4675"]]);
8
8
  export {
9
9
  QdServiceSelect as default
10
10
  };
@@ -404,7 +404,8 @@ 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];
407
+ const firstOption = data2.find((option) => !option.disabled);
408
+ if (!firstOption) return;
408
409
  const { keys, multiple, valueType } = reProps.value.selectOptions;
409
410
  const firstValue = valueType === "object" ? firstOption : firstOption[keys?.value || qdServiceSelectKeys.value];
410
411
  reModelValue.value = multiple ? [firstValue] : firstValue;
@@ -1,6 +1,7 @@
1
1
  export interface QdDictItem {
2
2
  label: string;
3
3
  value: string | number | boolean;
4
+ disabled?: boolean;
4
5
  remark?: string;
5
6
  class?: string;
6
7
  theme?: 'default' | 'warning' | 'danger' | 'success' | 'primary' | 'text';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qidian-vue-ui",
3
- "version": "2.7.3",
3
+ "version": "2.7.4",
4
4
  "description": "基于 TDesign 的 QiDian Vue UI 组件库",
5
5
  "author": "qidian",
6
6
  "license": "MIT",