add:新增取消替换搜索栏

This commit is contained in:
zlong committed 2024-11-26 11:29:09 +08:00
1 parent 44cd3af80a
commit 7189c688cb
1 file changed
+4
+4
View File
@@ -107,6 +107,9 @@ const isSearch = ref<boolean>(false)
function handleSearchFocus() {
isSearch.value = false
}
function handleCancel() {
isSearch.value = true
}
const historyList = ref<{ name: string }[]>([
{ name: '猫' },
{ name: '狗' },
@@ -131,6 +134,7 @@ const findList = ref<{ name: string }[]>([
:cancel-button="isSearch ? 'none' : 'auto'"
:radius="20"
@focus="handleSearchFocus"
@cancel="handleCancel"
/>
</view>
<view v-show="!isSearch" class="mx-4 mt-4">