add:新增取消替换搜索栏
This commit is contained in:
1 parent
44cd3af80a
commit
7189c688cb
1 file changed
+4
@@ -107,6 +107,9 @@ const isSearch = ref<boolean>(false)
|
|||||||
function handleSearchFocus() {
|
function handleSearchFocus() {
|
||||||
isSearch.value = false
|
isSearch.value = false
|
||||||
}
|
}
|
||||||
|
function handleCancel() {
|
||||||
|
isSearch.value = true
|
||||||
|
}
|
||||||
const historyList = ref<{ name: string }[]>([
|
const historyList = ref<{ name: string }[]>([
|
||||||
{ name: '猫' },
|
{ name: '猫' },
|
||||||
{ name: '狗' },
|
{ name: '狗' },
|
||||||
@@ -131,6 +134,7 @@ const findList = ref<{ name: string }[]>([
|
|||||||
:cancel-button="isSearch ? 'none' : 'auto'"
|
:cancel-button="isSearch ? 'none' : 'auto'"
|
||||||
:radius="20"
|
:radius="20"
|
||||||
@focus="handleSearchFocus"
|
@focus="handleSearchFocus"
|
||||||
|
@cancel="handleCancel"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view v-show="!isSearch" class="mx-4 mt-4">
|
<view v-show="!isSearch" class="mx-4 mt-4">
|
||||||
|
|||||||
Reference in new issue
Block a user