修复我的列表搜索对最后一个字符的匹配问题

pull/389/head
lyswhut 2020-08-04 09:05:23 +08:00
parent e54597b944
commit 078245cb96
2 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,8 @@
### 修复
- 修复使用全局快捷键还原窗口时,窗口没有获取焦点的问题
- 修复我的列表搜索对最后一个字符的匹配问题
### 优化

View File

@ -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)
}