File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 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}
You can’t perform that action at this time.
0 commit comments