穿梭框pinyin-match搜索不显示问题

 

<el-transfer
      ref="defTransfer"
      v-model="form.ids"
      filterable
      :filter-method="filterMethod"
      :titles="['可选项','已选项']"
      class="new-transfer def-transfer"
      :props="{
        key: 'lngaccountid',
        label: 'straccount',
        value:'lngaccountid'
      }"
      :data="accountList"
    />

 //这个只有搜索了才会有数据

filterMethod(query, item) {
      console.log(PinyinMatch.match(item.straccount, query))
      return PinyinMatch.match(item.straccount, query)
    },

//正确写法

filterMethod(query, item) {
      return query ? PinyinMatch.match(item.straccount, query) : item
    },

 

posted @ 2021-10-12 17:23  hello芳芳  阅读(119)  评论(0编辑  收藏  举报