<template>
	<el-select v-model="accept_id" v-selectloadmore:rangeNum="() => rangeNum += 10" filterable :filter-method="filterMethod" placeholder="选择接收方">
   <el-option v-for="item in acceptList.slice(0,rangeNum)" :key="item.id" :value="item.id" :label="item.name">
     {{ item.name }}
   </el-option>
 </el-select>
</template>
<script>
 export default {
    props: ["value"],
   	directives: {
	    'selectloadmore': {
	      bind(el, binding) {
	        const selectDom = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
	        selectDom.addEventListener('scroll', () => {
	          if (selectDom.scrollHeight - selectDom.scrollTop <= selectDom.clientHeight + 20) {
	            binding.value()
	          }
	        })
	      }
	    }
	 },
	data(){
		return {
			accept_id:undefined,
			acceptList:[],
			copyAcceptList:[],
			rangeNum: 20,
		}
	},
	mounted(){
		//获得acceptList的数据
	},
	methods:{
		filterMethod (){
			this.rangeNum = 20
			//请求接口,筛选数据
		}
	}
}
</script>