1👍
I think your are looking for something like this.
<v-select
:items="options"
:item-title="(item)=>`${item.code} = ${item.text}`"
:item-value="(item)=>`${item.code}`"
label="Select"
multiple
>
<template v-slot:selection="{ item }">
{{ item.value }}
</template>
</v-select>
- [Vuejs]-Vue component does not update when data is changed external
- [Vuejs]-Vue.JS – How to have a button perform two separate actions on the same parent element?
0👍
There are slots for this kind of customization. You can use the singleLabel
slot to customize the selected option, and the option
slot to customize each dropdown option
<multiselect v-model="value" :options="options">
<template #singleLabel="{ option }">
<div>{{ option.code }}</div>
</template>
<template #option="{ option }">
<div>{{ option.code }} - {{ option.text }}</div>
</template>
</multiselect>
Source:stackexchange.com