feat: 搜索框内添加检索总条数

This commit is contained in:
ZiuChen 2022-08-25 21:46:40 +08:00
parent eafcb6b93f
commit 8a04564920
2 changed files with 9 additions and 2 deletions

View File

@ -1,6 +1,10 @@
<template> <template>
<div class="clip-search"> <div class="clip-search">
<input v-model="filterText" type="text" placeholder="🔍 检索剪贴板历史" /> <input
v-model="filterText"
type="text"
:placeholder="itemCount ? `🔍 在${itemCount}条历史中检索...` : '🔍 检索剪贴板历史...'"
/>
<span v-show="filterText" @click="clear" class="clip-search-suffix"></span> <span v-show="filterText" @click="clear" class="clip-search-suffix"></span>
</div> </div>
</template> </template>
@ -11,6 +15,9 @@ const props = defineProps({
modelValue: { modelValue: {
type: String, type: String,
required: true required: true
},
itemCount: {
type: Number
} }
}) })
const filterText = ref('') const filterText = ref('')

View File

@ -8,7 +8,7 @@
></ClipFullData> ></ClipFullData>
<ClipSwitch ref="ClipSwitchRef" @onNavClick="handleNavClick"> <ClipSwitch ref="ClipSwitchRef" @onNavClick="handleNavClick">
<template #SidePanel> <template #SidePanel>
<ClipSearch v-model="filterText"></ClipSearch> <ClipSearch v-model="filterText" :itemCount="showList.length"></ClipSearch>
</template> </template>
</ClipSwitch> </ClipSwitch>
<div class="clip-break"></div> <div class="clip-break"></div>