refactor(baInput):远程下拉组件增加 attr 属性

This commit is contained in:
妙码生花 2023-07-17 02:27:20 +08:00
parent 0f45c73d09
commit 36f7b8605b

View File

@ -28,6 +28,7 @@
:key="state.selectKey"
@clear="onClear"
@visible-change="onVisibleChange"
v-bind="props.attr"
>
<el-option
class="remote-select-option"
@ -67,6 +68,7 @@ import { isEmpty } from 'lodash-es'
import { getArrayKey } from '/@/utils/common'
const selectRef = ref<InstanceType<typeof ElSelect> | undefined>()
type ElSelectProps = Partial<InstanceType<typeof ElSelect>['$props']>
type valType = string | number | string[] | number[]
interface Props {
@ -78,6 +80,7 @@ interface Props {
modelValue: valType
labelFormatter?: (optionData: anyObj, optionKey: string) => string
tooltipParams?: anyObj
attr?: ElSelectProps
}
const props = withDefaults(defineProps<Props>(), {
pk: 'id',
@ -91,6 +94,9 @@ const props = withDefaults(defineProps<Props>(), {
tooltipParams: () => {
return {}
},
attr: () => {
return {}
},
})
const state: {