其他分享
首页 > 其他分享> > ant design vue带有远程搜索,节流控制,请求时序控制,加载状态的下拉选择框a-select 与 a-select-option 踩坑,清除后placeholder不显示

ant design vue带有远程搜索,节流控制,请求时序控制,加载状态的下拉选择框a-select 与 a-select-option 踩坑,清除后placeholder不显示

作者:互联网

<template>
  <a-select
    allowClear
    :value="value"
    @search="fetchData"
    @change="selectChange"
    :placeholder="holder"
    :not-found-content="fetching ? undefined : '暂无数据'"
    :filterOption="false"
    :getPopupContainer="triggerNode => triggerNode.parentNode"
    :showSearch="true"
    style="width: 100%"
  >
    <a-spin v-if="fetching" slot="notFoundContent" size="small"></a-spin>
    <a-select-option v-for="item in selectData" :key="item.key">{{ item.value }}</a-select-option>
  </a-select>
</template>
props: {
    value: {
      default: undefined
    },
  },
      
// 父组件:      
change(value) {
    this.form.userValue = value ? value.key : undefined;
}

Select props

标签:vue,undefined,value,ant,change,props,placeholder,select
来源: https://blog.csdn.net/MrChkk/article/details/120486122