-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
组件支持data-,aria-,role的属性 #1150
Comments
@handoudou Flex 是布局组件,我的观点是他不应该加很多业务属性,你可以把你的 data 这些放在 children 自己的容器元素上? |
这个 issue 还得 reopen,目前有很多组件还不支持 |
|
那也行,这里那就先关掉吧,后面自查好了 |
直接把 restProps 传下去会引发意想不到的问题,比如 ant-design/ant-design#2258
初看这个问题可能认为是用户使用不当,不该传入 div 不支持的属性 const Result = styled(Flex.Item)`
color: ${({ warning }) => warning ? 'red' : 'gray'};
`
render () {
return(
<Result warning={!!this.state.error}>abc</Result>
)
} |
@cncolder 我感觉这是 styled-components 的问题,不然难道 antd-mobile 所有 component 在最下层要去做剔除不合法 props 的事情? |
@paranoidjk styled-components 只是一个例子,HOC 组件都是把自己的属性提取出来,其他属性向下传的。 这个先保持现状吧,是我理解错了,刚看了一下 antd 和 mdl,他们也没做处理直接向下传给 DOM。
|
标准属性长期还是需要支持的,按这个标准来吧: https://facebook.github.io/react/docs/dom-elements.html#all-supported-html-attributes |
@likezero 在这里统一再梳理下吧 |
antd-mobile version(antd-mobile版本):1.0.8
Browser (or mark react-native) and its version(浏览器或react-native版本): 浏览器
What did you do? Please provide steps to re-produce your problem.(请提供复现步骤)
What do you expected?(预期的正常效果)
目前组件支持data-,aria-,role的属性

What happen?(发生了何种非正常现象)
目前组件不支持data-,aria-,role的属性
The text was updated successfully, but these errors were encountered: