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
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>
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 thenamebut I want the component to filter using a property calledfullname