update 降低搜索速率
This commit is contained in:
@@ -10,6 +10,8 @@ export default {
|
||||
return {
|
||||
searchText: '',
|
||||
searchResult: [],
|
||||
|
||||
timer: null
|
||||
};
|
||||
},
|
||||
|
||||
@@ -44,6 +46,14 @@ export default {
|
||||
|
||||
|
||||
onSearch(value) {
|
||||
clearTimeout(this.timer)
|
||||
|
||||
this.timer = setTimeout(() => {
|
||||
this.doSearch(value)
|
||||
}, 300)
|
||||
},
|
||||
|
||||
doSearch(value) {
|
||||
this.searchText = value
|
||||
|
||||
const menus = this.$_.concat.apply(this, this.$_.cloneDeep(this.menus.map(p => p.menu)))
|
||||
|
||||
Reference in New Issue
Block a user