From 078245cb962486c490b8989fac13c8156220bea0 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Tue, 4 Aug 2020 09:05:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=88=91=E7=9A=84=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=90=9C=E7=B4=A2=E5=AF=B9=E6=9C=80=E5=90=8E=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=AD=97=E7=AC=A6=E7=9A=84=E5=8C=B9=E9=85=8D=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish/changeLog.md | 2 ++ src/renderer/components/material/SearchList.vue | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/publish/changeLog.md b/publish/changeLog.md index 17c66566..5a3b93e5 100644 --- a/publish/changeLog.md +++ b/publish/changeLog.md @@ -1,6 +1,8 @@ + ### 修复 - 修复使用全局快捷键还原窗口时,窗口没有获取焦点的问题 +- 修复我的列表搜索对最后一个字符的匹配问题 ### 优化 diff --git a/src/renderer/components/material/SearchList.vue b/src/renderer/components/material/SearchList.vue index 4e55a03a..a070478f 100644 --- a/src/renderer/components/material/SearchList.vue +++ b/src/renderer/components/material/SearchList.vue @@ -239,7 +239,7 @@ export default { handleSearch() { if (!this.text.length) return this.resultList = [] let list = [] - let rxp = new RegExp(this.text.split('').join('.*'), 'i') + let rxp = new RegExp(this.text.split('').join('.*') + '.*', 'i') for (const item of this.list) { if (rxp.test(`${item.name}${item.singer}${item.albumName ? item.albumName : ''}`)) list.push(item) }