fix(ApiSelect): type warning
parent
9915eab368
commit
15a0cadbf1
|
@ -12,9 +12,7 @@ import { propTypes } from '@/utils/propTypes'
|
||||||
defineOptions({ name: 'ApiSelect', inheritAttrs: false })
|
defineOptions({ name: 'ApiSelect', inheritAttrs: false })
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
value: {
|
value: { type: Object as PropType<SelectValue> },
|
||||||
type: [Array, Object, String, Number] as PropType<SelectValue>,
|
|
||||||
},
|
|
||||||
numberToString: propTypes.bool,
|
numberToString: propTypes.bool,
|
||||||
api: {
|
api: {
|
||||||
type: Function as PropType<(arg?: Recordable) => Promise<OptionsItem[]>>,
|
type: Function as PropType<(arg?: Recordable) => Promise<OptionsItem[]>>,
|
||||||
|
@ -31,6 +29,10 @@ const props = defineProps({
|
||||||
valueField: propTypes.string.def('value'),
|
valueField: propTypes.string.def('value'),
|
||||||
immediate: propTypes.bool.def(true),
|
immediate: propTypes.bool.def(true),
|
||||||
alwaysLoad: propTypes.bool.def(true),
|
alwaysLoad: propTypes.bool.def(true),
|
||||||
|
options: {
|
||||||
|
type: Array<OptionsItem>,
|
||||||
|
default: [],
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['optionsChange', 'change', 'update:value'])
|
const emit = defineEmits(['optionsChange', 'change', 'update:value'])
|
||||||
|
@ -41,7 +43,7 @@ const options = ref<OptionsItem[]>([])
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
// 首次是否加载过了
|
// 首次是否加载过了
|
||||||
const isFirstLoaded = ref(false)
|
const isFirstLoaded = ref(false)
|
||||||
const emitData = ref<any[]>([])
|
const emitData = ref<OptionsItem[]>([])
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
// Embedded in the form, just use the hook binding to perform form verification
|
// Embedded in the form, just use the hook binding to perform form verification
|
||||||
|
|
Loading…
Reference in New Issue