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