We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CommnetInput>handleSubmit()中,建议加上一句判断,如果用户名为空,则除了提示输入用户名之外,应该保留内容,这样应该更符合实际。
`` handleSubmit () { if (this.props.onSubmit) { const user = this.state.user const content = this.state.content // const { user, content } = this.state this.props.onSubmit({ user, content }) } if (!this.state.user) return//如果用户名为空,则到此返回 this.setState ({ content:"" }) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
CommnetInput>handleSubmit()中,建议加上一句判断,如果用户名为空,则除了提示输入用户名之外,应该保留内容,这样应该更符合实际。
`` handleSubmit () {
if (this.props.onSubmit) {
const user = this.state.user
const content = this.state.content
// const { user, content } = this.state
this.props.onSubmit({ user, content })
}
if (!this.state.user)
return//如果用户名为空,则到此返回
this.setState ({ content:"" })
}
The text was updated successfully, but these errors were encountered: