mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-15 05:12:49 +00:00
perf: 搜索消息时按esc取消搜索
This commit is contained in:
parent
b7fc815d58
commit
8215e73a95
@ -5,7 +5,13 @@
|
||||
<div class="messenger-select">
|
||||
<div class="messenger-search">
|
||||
<div class="search-wrapper">
|
||||
<Input v-if="tabActive==='dialog'" v-model="dialogSearchKey" :placeholder="$L(loadDialogs ? '更新中...' : '搜索消息')" clearable >
|
||||
<Input
|
||||
v-if="tabActive==='dialog'"
|
||||
v-model="dialogSearchKey"
|
||||
ref="searchInput"
|
||||
:placeholder="$L(loadDialogs ? '更新中...' : '搜索消息')"
|
||||
@on-keydown="onKeydown"
|
||||
clearable>
|
||||
<div class="search-pre" slot="prefix">
|
||||
<Loading v-if="loadDialogs || dialogSearchLoad > 0"/>
|
||||
<Icon v-else type="ios-search" />
|
||||
@ -565,6 +571,12 @@ export default {
|
||||
return scrollInfo.scrollE
|
||||
},
|
||||
|
||||
onKeydown(e) {
|
||||
if (e.key === "Escape") {
|
||||
this.$refs.searchInput.handleClear()
|
||||
}
|
||||
},
|
||||
|
||||
onActive(type) {
|
||||
if (type === null) {
|
||||
if (this.tabActive !== 'dialog') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user