提交 36e6dfa6 编写于 作者: zhujiamin's avatar zhujiamin

debug搜索历史组件 清除功能完善

上级 d19a2b5a
......@@ -79,8 +79,10 @@ export default class AppRoundList extends Vue{
* @memberof AppSearchHistory
*/
@Watch('historyList')
onHistoryListChange(){
this.hasHistory = true;
onHistoryListChange(newVal:any){
if (newVal.length != 0) {
this.hasHistory = true;
}
}
/**
......@@ -207,6 +209,10 @@ export default class AppRoundList extends Vue{
this.historyList.pop();
}
if (this.enableHistory) {
this.historyLists = this.historyStorage.find((historyLists:any)=>{
return historyLists.viewname == this.model.viewname;
})
this.historyLists.historyList = this.historyList;
localStorage.setItem('historyStorage', JSON.stringify(this.historyStorage))
}
}
......@@ -222,7 +228,6 @@ export default class AppRoundList extends Vue{
if (result) {
this.historyList = [];
this.historyLists.historyList = [];
this.historyStorage.splice(this.historyStorage.indexOf(this.historyLists),1);
localStorage.setItem('historyStorage', JSON.stringify(this.historyStorage))
return true;
} else {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册