fix: show clear icon only when search is input

This commit is contained in:
puri-ph4tt 2023-12-06 16:41:02 +07:00
parent c726b9abb4
commit 2ca3355366
2 changed files with 31 additions and 6 deletions

View file

@ -96,7 +96,7 @@ function clearAdvSearchData() {
<div class="row items-center" style="width: 45px; height: 45px">
<q-btn
dense
color="teal"
color="teal-5"
icon="mdi-plus"
v-if="index === advSearchDataRow.length - 1"
@click="addAdvSearchData"
@ -135,6 +135,7 @@ function clearAdvSearchData() {
@keydown.enter.prevent="searchSubmit()"
><template v-slot:append>
<q-icon
v-if="item.value"
name="close"
@click="() => (item.value = '')"
class="cursor-pointer"
@ -172,24 +173,34 @@ function clearAdvSearchData() {
outlined
dense
v-model="advSearchDataField.keyword"
placeholder="คำสำคัญ"
use-input
use-chips
multiple
hide-dropdown-icon
input-debounce="0"
new-value-mode="add"
/>
new-value-mode="add-unique"
><template v-slot:prepend
><span class="text-subtitle2">คำสำค:</span></template
></q-select
>
</div>
<div class="col-12 col-md-grow">
<q-input
id="advSearchDes"
dense
outlined
placeholder="รายละเอียด"
@keydown.enter.prevent="searchSubmit()"
v-model="advSearchDataField.description"
/>
><template v-slot:prepend
><span class="text-subtitle2">รายละเอยด:</span></template
><template v-slot:append>
<q-icon
v-if="advSearchDataField.description"
name="close"
@click="() => (advSearchDataField.description = '')"
class="cursor-pointer"
/> </template
></q-input>
</div>
</div>
</div>