Vue-select: Search field different than label

Created on 4 May 2018  路  8Comments  路  Source: sagalbot/vue-select

Hello,

I'm trying to have vue-select search within a specific field (eg "fullname") while the label is set to another field (eg "name)". I'm guessing that should be done with the filterFunction prop, but I cannot find a way to use it.

Any help much appreciated

Most helpful comment

Thanks for your help, I'm afraid you are not getting my point:
I've set label="name" so that the displayed value and the elements in the dropdown list are the name but I want the component to filter using a property called fullname

All 8 comments

just use label="name"

@xhijack I have already set label="name" but I want to filter using a different property called fullname.
Thanks

and then you just set label="fullname"

Thanks for your help, I'm afraid you are not getting my point:
I've set label="name" so that the displayed value and the elements in the dropdown list are the name but I want the component to filter using a property called fullname

Seems like filterFunction is documented but not actually implemented.

I investigated it more. filterFunction got renamed to filterBy and the feature has never been released. The solution is to use the master branch rather than any release.

@teocomi It's an old issue, but maybe someone will find it usefull.

<v-select :label="'fullname'">
  <template
    slot="option"
    slot-scope="option">
    <div class="d-center">
      {{ option.name }}
    </div>
  </template>
  <template
    slot="selected-option"
    slot-scope="option">
    <div class="d-center">
      {{ option.name }}
    </div>
  </template>
</v-select>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ducdev picture ducdev  路  3Comments

xuwenhao picture xuwenhao  路  3Comments

FrancescoMussi picture FrancescoMussi  路  3Comments

jluterek picture jluterek  路  3Comments

davidalvarezr picture davidalvarezr  路  3Comments