antdesign select多选搜索不换行,类似element的select实现方式

<a-select
    :placeholder="placeholder"
    mode="multiple"
    show-arrow
    show-search
    class="y_select"
 > 

 

.y_select {
  width: 100%;
  ::v-deep .ant-select-selection--multiple {
    .ant-select-selection__rendered{
      display: flex;
    }
    .ant-select-selection__rendered {
      ul {
        display: flex;
        width: 100%;
        & > li {
          flex-shrink: 0;
        }
        .ant-select-search {
          flex: 1;
        }
        .ant-select-search__field {
          width: 100% !important;
        }
      }
    }
  }
}

 

posted on 2024-03-25 17:33  写最骚的代码  阅读(174)  评论(0编辑  收藏  举报