Skip to content

Commit

Permalink
fix(ApiSelect): type warning
Browse files Browse the repository at this point in the history
  • Loading branch information
likui628 committed Oct 14, 2023
1 parent a0d4b10 commit 8f6153f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/Form/src/components/ApiSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<script lang="ts">
import { defineComponent, PropType, ref, computed, unref, watch } from 'vue';
import { Select } from 'ant-design-vue';
import type { SelectValue } from 'ant-design-vue/es/select';
import { isFunction } from '/@/utils/is';
import { useRuleFormItem } from '/@/hooks/component/useFormItem';
import { useAttrs } from '@vben/hooks';
Expand All @@ -41,7 +42,7 @@
},
inheritAttrs: false,
props: {
value: [Array, Object, String, Number],
value: { type: Object as PropType<SelectValue> },
numberToString: propTypes.bool,
api: {
type: Function as PropType<(arg?: any) => Promise<OptionsItem[]>>,
Expand All @@ -55,15 +56,18 @@
valueField: propTypes.string.def('value'),
immediate: propTypes.bool.def(true),
alwaysLoad: propTypes.bool.def(false),
options: propTypes.array.def([]),
options: {
type: Array<OptionsItem>,
default: [],
},
},
emits: ['options-change', 'change', 'update:value'],
setup(props, { emit }) {
const options = ref<OptionsItem[]>([]);
const loading = ref(false);
// 首次是否加载过了
const isFirstLoaded = ref(false);
const emitData = ref<any[]>([]);
const emitData = ref<OptionsItem[]>([]);
const attrs = useAttrs();
const { t } = useI18n();
Expand Down

0 comments on commit 8f6153f

Please sign in to comment.