Browse Source

repos square

repo-square
chenshihai 2 years ago
parent
commit
851b5fff08
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      web_src/vuepages/pages/repos/components/SearchBar.vue

+ 6
- 4
web_src/vuepages/pages/repos/components/SearchBar.vue View File

@@ -88,9 +88,9 @@ export default {
this.selectTopic && this.changeTopic({
k: this.selectTopic.toLocaleLowerCase(),
v: this.selectTopic,
}, true)
}, true);
},
changeTopic(topicItem, noSearch) {
changeTopic(topicItem, noSearch) {
const index_ori = this.topicOri.findIndex((item) => {
return item.k == this.selectTopic.toLocaleLowerCase();
});
@@ -98,7 +98,9 @@ export default {
const index = this.topics.findIndex((item) => {
return item.k == this.selectTopic.toLocaleLowerCase();
});
this.topics.splice(index, 1);
if (index > -1) {
this.topics.splice(index, 1);
}
}
this.selectTopic = topicItem.v;
if (this.selectTopic && this.topics.indexOf(this.selectTopic) < 0) {
@@ -120,7 +122,7 @@ export default {
const topics = topicsData.map((item) => {
return {
k: item.toLocaleLowerCase(),
v: item,
v: item.trim(),
}
});
this.topicOri = JSON.parse(JSON.stringify(topics));


Loading…
Cancel
Save