Skip to content
New issue

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

一个小建议 #9

Open
leoxiong7289 opened this issue Nov 7, 2019 · 0 comments
Open

一个小建议 #9

leoxiong7289 opened this issue Nov 7, 2019 · 0 comments

Comments

@leoxiong7289
Copy link

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:"" })
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant