Skip to content
This repository has been archived by the owner on Nov 15, 2018. It is now read-only.

Commit

Permalink
fix(question): (#565) 提问时不能选择重复的话题
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Oct 24, 2018
1 parent 1170429 commit 8fcd742
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/page/post/PostQuestion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,12 @@ export default {
},
methods: {
selectedTopic(topic) {
const index = this.selectedTops.indexOf(topic);
index > -1
? this.selectedTops.splice(index, 1)
: this.selectedTops.length > 4
? this.$Message.error("添加专题不可以超过5个")
: this.selectedTops.push(topic);
if (this.selectedTops.includes(topic))
return this.$Message.error("专题不能重复");
if (this.selectedTops.length > 4)
return this.$Message.error("添加专题不可以超过5个");
this.selectedTops.push(topic);
},
/**
* 搜索问题
Expand Down

0 comments on commit 8fcd742

Please sign in to comment.