mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-09-01 16:07:17 +00:00
feat: search ui
This commit is contained in:
@@ -1,13 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="dropdown" ref="wrapper">
|
<div class="dropdown" ref="wrapper">
|
||||||
<div class="dropdown-display" @click="toggle">
|
<div class="dropdown-display" @click="toggle">
|
||||||
<slot
|
<slot name="display" :selected="selectedLabels" :toggle="toggle" :search="search" :setSearch="setSearch">
|
||||||
name="display"
|
|
||||||
:selected="selectedLabels"
|
|
||||||
:toggle="toggle"
|
|
||||||
:search="search"
|
|
||||||
:setSearch="setSearch"
|
|
||||||
>
|
|
||||||
<template v-if="multiple">
|
<template v-if="multiple">
|
||||||
<span v-if="selectedLabels.length">
|
<span v-if="selectedLabels.length">
|
||||||
<template v-for="(label, idx) in selectedLabels" :key="label.id">
|
<template v-for="(label, idx) in selectedLabels" :key="label.id">
|
||||||
|
|||||||
@@ -9,12 +9,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #option="{ option }">
|
<template #option="{ option }">
|
||||||
|
<div class="search-option-item">
|
||||||
<i :class="['result-icon', iconMap[option.type] || 'fas fa-question']"></i>
|
<i :class="['result-icon', iconMap[option.type] || 'fas fa-question']"></i>
|
||||||
<div class="result-body">
|
<div class="result-body">
|
||||||
<div class="result-main" v-html="highlight(option.text)"></div>
|
<div class="result-main" v-html="highlight(option.text)"></div>
|
||||||
<div v-if="option.subText" class="result-sub" v-html="highlight(option.subText)"></div>
|
<div v-if="option.subText" class="result-sub" v-html="highlight(option.subText)"></div>
|
||||||
<div v-if="option.extra" class="result-extra" v-html="highlight(option.extra)"></div>
|
<div v-if="option.extra" class="result-extra" v-html="highlight(option.extra)"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</div>
|
</div>
|
||||||
@@ -89,6 +91,11 @@ export default {
|
|||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-option-item {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.search-option {
|
.search-option {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user