-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
New Login component #147
New Login component #147
Conversation
55c0e8c
to
8536319
Compare
API 搞成可组合的如何? <Login>
<Login.Username />
<Login.Password />
<Login.Captcha />
<Login.Submit>提交</Login.Submit>
</Login> |
这样也不是很好搞,还要跟 tabs 结合到一起,要分组,还要有每组的title之类的 |
<Login onSubmit={}>
<Login.Tab title="xx">
<Login.Username />
<Login.Password />
<Login.Captcha />
<div>可以加任何东西</div>
</Login.Tab>
<Login.Tab title="yy">
<Login.Username />
<Login.Password />
<div>可以加任何东西</div>
</Login.Tab>
<Login.Submit>提交</Login.Submit>
</Login> |
这样在结构上确实比较灵活,但如果自定义部分需要新增输入控件,好像没有很好的方式把新增的key挂到对应的tab下?这样校验和提交数据的时候有点麻烦。 |
用户自行同步到 state 里面并在 onSubmit 时合并即可。组件不管这个。 |
那校验也需要完全自己写了,包括onChange和onSubmit的时候。。。我试下 |
需要自定义,还是可以组合 Form 和 Form.Item 吧。 |
Login 里肯定包含 Form 了,自定义里面只能直接写 FormItem |
src/components/Login/demo/basic.md
Outdated
this.state.notice && | ||
<Alert style={{ marginBottom: 24 }} message={this.state.notice} type="error" showIcon closable /> | ||
} | ||
<UserName itemKey="username" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
itemKey => name?
} | ||
#scaffold-src-components-Login-demo-basic .icon-weibo:hover { | ||
background-position: 0 -48px; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这几个图标有在 iconfont 里的。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weibo 和 taobao 么有 circle 的,等设计师加好后更新
27ad253
to
660f70e
Compare
@ddcat1115 Rebase 一下 master。66583a7 临时修掉了这个问题。 nikogu/roadhog-api-doc#12 等 @nikogu 回来发个新版。 |
src/e2e/login.e2e.js
Outdated
@@ -8,15 +8,17 @@ describe('Login', () => { | |||
}); | |||
|
|||
it('should login with failure', async () => { | |||
await page.type('#userName', 'mockuser') | |||
await page.wait(5000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个应该也不需要了。
@ddcat1115 这个代码思路迫切需要,请问在Login组件中如何支持和自定义控件配合使用? |
fe2fd93
to
782fe9b
Compare
本地一直是通过的 😓 |
|
|
dist 下也通过的 |
0014799
to
4698b57
Compare
src/components/Login/index.js
Outdated
const TabChildren = []; | ||
const otherChildren = []; | ||
React.Children.forEach(children, (item) => { | ||
if (item.type.name === 'LoginTab') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里出了问题。
基本确定用法后再同步到脚手架~
#45