|
|
@ -2,6 +2,7 @@ |
|
|
<Select |
|
|
<Select |
|
|
@dropdownVisibleChange="handleFetch" |
|
|
@dropdownVisibleChange="handleFetch" |
|
|
v-bind="attrs" |
|
|
v-bind="attrs" |
|
|
|
|
|
@change="handleChange" |
|
|
:options="getOptions" |
|
|
:options="getOptions" |
|
|
v-model:value="state" |
|
|
v-model:value="state" |
|
|
> |
|
|
> |
|
|
@ -67,11 +68,12 @@ |
|
|
const options = ref<OptionsItem[]>([]); |
|
|
const options = ref<OptionsItem[]>([]); |
|
|
const loading = ref(false); |
|
|
const loading = ref(false); |
|
|
const isFirstLoad = ref(true); |
|
|
const isFirstLoad = ref(true); |
|
|
|
|
|
const emitData = ref<any[]>([]); |
|
|
const attrs = useAttrs(); |
|
|
const attrs = useAttrs(); |
|
|
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 |
|
|
const [state] = useRuleFormItem(props); |
|
|
const [state] = useRuleFormItem(props, 'value', 'change', emitData); |
|
|
|
|
|
|
|
|
const getOptions = computed(() => { |
|
|
const getOptions = computed(() => { |
|
|
const { labelField, valueField, numberToString } = props; |
|
|
const { labelField, valueField, numberToString } = props; |
|
|
@ -135,7 +137,11 @@ |
|
|
emit('options-change', unref(options)); |
|
|
emit('options-change', unref(options)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return { state, attrs, getOptions, loading, t, handleFetch }; |
|
|
function handleChange(_, ...args) { |
|
|
|
|
|
emitData.value = args; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return { state, attrs, getOptions, loading, t, handleFetch, handleChange }; |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
</script> |
|
|
</script> |
|
|
|