新增热搜词、历史搜索记录

This commit is contained in:
lyswhut
2020-03-15 17:17:41 +08:00
parent 9d1270374e
commit 670533807a
29 changed files with 460 additions and 18 deletions
+9
View File
@@ -53,6 +53,9 @@ export default {
downloadList: 'list',
downloadStatus: 'downloadStatus',
}),
...mapGetters('search', {
searchHistoryList: 'historyList',
}),
},
created() {
this.saveSetting = throttle(n => {
@@ -67,6 +70,9 @@ export default {
this.saveDownloadList = throttle(n => {
window.electronStore_list.set('downloadList', n)
}, 1000)
this.saveSearchHistoryList = throttle(n => {
window.electronStore_data.set('searchHistoryList', n)
}, 1000)
},
mounted() {
document.body.classList.add(this.isNt ? 'noTransparent' : 'transparent')
@@ -97,6 +103,9 @@ export default {
},
deep: true,
},
searchHistoryList(n) {
this.saveSearchHistoryList(n)
},
'globalObj.apiSource'(n) {
if (n != this.setting.apiSource) {
this.setSetting(Object.assign({}, this.setting, {