Commit e5fb1e96 by 冷斌

fix bug

parent 5cebab15
......@@ -421,19 +421,16 @@
},
searchSave: function () {
let item = localStorage.getItem("search");
console.log(item);
//['考研课程', '事业单位考试', '公务员考试'];
let data = item ? JSON.parse(item) : [];
console.log(data);
if (data.indexOf(this.keyword) < 0) {
data.push(this.keyword);
}
console.log(data);
if (data.length > 8) {
data.shift();
}
console.log(data);
localStorage.setItem("search", JSON.stringify(data));
this.cacheKeyWorlds();
}
}
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment