1
0

Show label colors when searching for labels

This commit is contained in:
kolaente
2021-01-14 22:06:22 +01:00
parent 6db151d57a
commit 526eee361f
3 changed files with 21 additions and 4 deletions

View File

@ -44,7 +44,9 @@
>
<span>
<slot name="searchResult" :option="query">
{{ query }}
<span class="search-result">
{{ query }}
</span>
</slot>
</span>
<span class="hint-text">
@ -63,7 +65,7 @@
>
<span>
<slot name="searchResult" :option="data">
{{ label !== '' ? data[label] : data }}
<span class="search-result">{{ label !== '' ? data[label] : data }}</span>
</slot>
</span>
<span class="hint-text">

View File

@ -20,6 +20,19 @@
<a @click="removeLabel(props.item)" class="delete is-small"></a>
</span>
</template>
<template v-slot:searchResult="props">
<span
v-if="typeof props.option === 'string'"
class="tag ml-2">
<span>{{ props.option }}</span>
</span>
<span
v-else
:style="{'background': props.option.hexColor, 'color': props.option.textColor}"
class="tag ml-2">
<span>{{ props.option.title }}</span>
</span>
</template>
</multiselect>
</template>