forked from alibaba-fusion/next
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 无障碍 | ||
|
||
- order: 3 | ||
|
||
组件已支持无障碍。关于键盘操作请参考`ARIA and KeyBoard`。 | ||
|
||
|
||
:::lang=en-us | ||
# Accessibility | ||
|
||
- order: 3 | ||
|
||
Components already support accessibility.Please refer to `ARIA and KeyBoard` for keyboard operation. | ||
|
||
::: | ||
--- | ||
|
||
````jsx | ||
import { Tag, Icon } from '@alifd/next'; | ||
|
||
const {Group: TagGroup} = Tag; | ||
|
||
|
||
const dataType = ['全部', '衣服', '手机', '化妆品']; | ||
|
||
|
||
class Demo extends React.Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
name:'' | ||
}; | ||
this.onclick = this.onclick.bind(this); | ||
} | ||
onclick(v) { | ||
this.setState({name: v.item}); | ||
} | ||
render() { | ||
return (<div> | ||
<TagGroup> | ||
{dataType.map(item => <Tag type="normal" key={item} size="medium" onClick={() => this.onclick({item})} >{ item }</Tag>) } | ||
</TagGroup> | ||
{this.state.name} | ||
</div>); | ||
} | ||
} | ||
ReactDOM.render(<Demo />, mountNode); | ||
|
||
```` |