当select的数据太多时,查询很慢,并且样式不美观,需要实现分页功能。
如果很多页面都需要分页下拉,新建一个组件。
代码如下:
<template>
<el-select v-model="copyValue"
:disabled="disabled"
filterable
clearable
@clear="selectClear"
placeholder="请选择"
@change="updateValue"
:filter-method="filterMethod"
@focus="focusMethod"
>
<el-option
v-for="item in dataList"
:key="item.value"
:label="item[labelKey]"
:value="item[valueKey]+'-'+item[labelKey]"
>
</el-option>
<div style="float: right;margin-right:10px;padding-bottom: 1