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

Commit

Permalink
fix(question): (#598) 自动补全问题末尾的问号
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Nov 7, 2018
1 parent f92ebec commit 23b6d15
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/page/post/PostQuestion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,17 +268,19 @@ export default {
},
nextStep() {
if (this.disabled) return;
this.step < 4 &&
((this.animated = {
if (this.step < 4) {
this.animated = {
enterClass: "animated slideInRight",
leaveClass: "animated slideOutLeft"
}),
this.step === 1
? this.question.title.endsWith("?") ||
this.question.title.endsWith("")
? (this.step = 2)
: this.$Message.error(`输入问题请以"?"结束`)
: (this.step += 1));
};
var endsWithQuesionMark =
this.question.title.endsWith("?") ||
this.question.title.endsWith("");
if (this.step === 1 && endsWithQuesionMark) {
this.question.title += "?";
}
this.step += 1;
}
},
beforePost() {
const { body, title } = this.question;
Expand Down

0 comments on commit 23b6d15

Please sign in to comment.