Show label colors when searching for labels
This commit is contained in:
parent
6db151d57a
commit
526eee361f
3 changed files with 21 additions and 4 deletions
|
@ -44,7 +44,9 @@
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
<slot name="searchResult" :option="query">
|
<slot name="searchResult" :option="query">
|
||||||
|
<span class="search-result">
|
||||||
{{ query }}
|
{{ query }}
|
||||||
|
</span>
|
||||||
</slot>
|
</slot>
|
||||||
</span>
|
</span>
|
||||||
<span class="hint-text">
|
<span class="hint-text">
|
||||||
|
@ -63,7 +65,7 @@
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
<slot name="searchResult" :option="data">
|
<slot name="searchResult" :option="data">
|
||||||
{{ label !== '' ? data[label] : data }}
|
<span class="search-result">{{ label !== '' ? data[label] : data }}</span>
|
||||||
</slot>
|
</slot>
|
||||||
</span>
|
</span>
|
||||||
<span class="hint-text">
|
<span class="hint-text">
|
||||||
|
|
|
@ -20,6 +20,19 @@
|
||||||
<a @click="removeLabel(props.item)" class="delete is-small"></a>
|
<a @click="removeLabel(props.item)" class="delete is-small"></a>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</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>
|
</multiselect>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -80,23 +80,25 @@
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
font-family: $family-sans-serif;
|
font-family: $family-sans-serif;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
span:first-child {
|
.search-result {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
padding: .5rem 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hint-text {
|
.hint-text {
|
||||||
font-size: .75rem;
|
font-size: .75rem;
|
||||||
color: transparent;
|
color: transparent;
|
||||||
transition: color $transition;
|
transition: color $transition;
|
||||||
padding-left: .5rem;
|
padding: 0 .5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus, &:hover {
|
&:focus, &:hover {
|
||||||
|
|
Loading…
Reference in a new issue