SelectRemote 选择器
基础使用
<dg-select-remote :modelValue="value" :api="api" />
<script setup>
const value = ref('')
const api = function () {
return new Promise(resolve => resolve({data: {data: []}}))
}
</script>
Attributes
| 参数 | 类型 | 说明 | 可选值 | 默认值 |
|---|---|---|---|---|
| modelValue | string | number | object | null | |||
| api | Function | 接口函数 | ||
| queryKey | string | 查询参数的key | ||
| labelKey | string | label的key | ||
| valueKey | string | 值的key | id | |
| rq | object | 分页参数 | ||
| defaultItem | optionModel | optionModel[] | 设置默认值 数据格式为 { label: '孙逸仙', value: 1 }, 该item出现在下拉框中的逻辑是输入框的值为空的时候 | - | |
| editorItem | optionModel | optionModel[] | 编辑时设置的值, 应用场景:编辑时设置的值不在第一页列表中时 | - | |
| isObjectValue | boolean | 当绑定值为对象时,设置该值为true | ||
| labelSolt | Function | 定义信息更丰富的label, 回调api返回列表的item, 返回值为string, 可返回富文本。 | ||
| selected | boolean | 是否在第一次请求api完成后选中第一个option |
TIP
其他参数请移步详细参数
