Skip to content
On this page

select下拉大数据量虚拟加载框


显示代码
html
<HuVirtualSelect :option="sizeData" v-model:value="value" key-field="value"></HuVirtualSelect>
<script setup>
  import { ref } from "vue"
const value = ref(null)
const sizeData = new Array(1000000).fill(1).map((v, i) => ({
  label: `名称${i}`,
  value: v + i,
}))
</script>

Attributes

参数说明类型默认值
option数据源Array[]
keyField数据的keyString'id'
placeholder提示语String'请输入'
itemHeight每项子集的高度Number34
height下拉框的高度Number180
popperAppendToBody是否加到body上Booleantrue
empty自定义缺省插槽slot草率的无数据

Event

参数说明类型默认值
focus获取焦点Function-
blur失去焦点Function-
change选择值Function(index,item)

Released under the MIT License.