Skip to content

Commit 1cb9df9

Browse files
committed
修改了搜索细节
1 parent fe0948d commit 1cb9df9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/renderer/components/SongList.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
<div class="music-location">
5050
<transition name="right-show" mode="out-in">
51-
<input class="form-input input-sm" v-model="musicFilter" v-show="showSearch" type="text" placeholder="过滤">
51+
<input class="form-input input-sm" v-model="musicFilter" @keyup.enter="quickSearch" v-show="showSearch" type="text" placeholder="过滤">
5252
</transition>
5353
<button class="btn btn-link" @click="clickSearch">
5454
<i class="icon icon-search"></i>
@@ -97,7 +97,6 @@ export default {
9797
},
9898
musicListFilter () {
9999
return this.musicList.map(music => {
100-
this.musicFilter === 'miku' && (this.musicFilter = `miku|初音`)
101100
let reg = new RegExp(`${this.musicFilter.toLowerCase()}`)
102101
const singerName = music.singerList.reduce((acc, singer) => acc + singer.singerName, '')
103102
return reg.test([music.songName, singerName, music.album.albumName].join(' ').toLowerCase())
@@ -131,6 +130,9 @@ export default {
131130
clickSearch () {
132131
this.showSearch = !this.showSearch
133132
!this.showSearch && (this.musicFilter = '')
133+
},
134+
quickSearch () {
135+
this.musicFilter === 'miku' && (this.musicFilter = `miku|初音`)
134136
}
135137
}
136138
}

0 commit comments

Comments
 (0)