Skip to content

Commit

Permalink
Translation Radio
Browse files Browse the repository at this point in the history
  • Loading branch information
ddcat1115 committed Apr 27, 2017
1 parent ea4087e commit 0c09022
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
16 changes: 8 additions & 8 deletions components/radio/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ class Test extends React.Component {
render() {
const { value, value2, value3, value4 } = this.state;
const data = [
{ value: 0, label: '博士' },
{ value: 1, label: '本科' },
{ value: 0, label: 'Doctor' },
{ value: 1, label: 'Bachelor' },
];
const data2 = [
{ value: 0, label: '篮球', extra: '辅助文字内容' },
{ value: 1, label: '足球', extra: '辅助文字内容' },
{ value: 0, label: 'Basketball', extra: 'Details' },
{ value: 1, label: 'Football', extra: 'Details' },
];

return (<div>
<List renderHeader={() => 'RadioItem 演示'}>
<List renderHeader={() => 'RadioItem Demo'}>
{data.map(i => (
<RadioItem key={i.value} checked={value === i.value} onChange={() => this.onChange(i.value)}>
{i.label}
Expand All @@ -58,7 +58,7 @@ class Test extends React.Component {
))}
</List>

<List renderHeader={() => '禁用状态'}>
<List renderHeader={() => 'Disabled'}>
{data.map(i => (
<RadioItem key={i.value} checked={value3 === i.value} onChange={() => this.onChange3(i.value)} disabled>
{i.label}
Expand All @@ -74,9 +74,9 @@ class Test extends React.Component {
))}
</List>
<Flex style={{ padding: '0.3rem' }}>
<Flex.Item style={{ padding: '0.3rem 0', color: '#888', flex: 'none' }}>Radio 演示 (自定义样式)</Flex.Item>
<Flex.Item style={{ padding: '0.3rem 0', color: '#888', flex: 'none' }}>Radio Demo(Customized style)</Flex.Item>
<Flex.Item>
<Radio className="my-radio" onChange={e => console.log('checkbox', e)}>同意协议</Radio>
<Radio className="my-radio" onChange={e => console.log('checkbox', e)}>Agree</Radio>
</Flex.Item>
</Flex>
</div>);
Expand Down
12 changes: 6 additions & 6 deletions components/radio/demo/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class BasicRadioExample extends React.Component<any, any> {
}}
style={{ borderWidth: 1, borderColor: '#999', margin: 10 }}
>
支持
Support
</Radio>
<WhiteSpace />
<Radio
Expand All @@ -39,7 +39,7 @@ export default class BasicRadioExample extends React.Component<any, any> {
</View>

<List style={{ marginTop: 12 }}>
<Text style={{ marginTop: 12 }}>表单单选项,普通列表中单选项</Text>
<Text style={{ marginTop: 12 }}>Form radio, radio in general list.</Text>
<RadioItem
checked={this.state.part2Value === 1}
onChange={(event) => {
Expand All @@ -48,7 +48,7 @@ export default class BasicRadioExample extends React.Component<any, any> {
}
}}
>
使用 Ant Desgin Component
Use Ant Desgin Component
</RadioItem>
<RadioItem
checked={this.state.part2Value === 2}
Expand All @@ -58,10 +58,10 @@ export default class BasicRadioExample extends React.Component<any, any> {
}
}}
>
使用 Ant Desgin Component
Use Ant Desgin Component
</RadioItem>
<RadioItem disabled>个性化调整disabled</RadioItem>
<RadioItem disabled checked>个性化调整disabled</RadioItem>
<RadioItem disabled>Set disabled</RadioItem>
<RadioItem disabled checked>Set disabled</RadioItem>
</List>
</View>
);
Expand Down
17 changes: 9 additions & 8 deletions components/radio/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type: Data Entry
title: Radio
---

单选框
Radio.

## API

Expand All @@ -14,13 +14,14 @@ Support WEB, React-Native.

Properties | Descrition | Type | Default
-----------|------------|------|--------
| name | name | String | |
| defaultChecked | 初始是否选中 | Boolean | |
| checked | 指定当前是否选中 | Boolean | |
| disabled | 禁用 | Boolean | false |
| onChange | change 事件触发的回调函数 | (e: Object): void | |
| name | name | String | - |
| defaultChecked | the initial checked state | Boolean | - |
| checked | to set the current checked state | Boolean | - |
| disabled | whether disabled | Boolean | false |
| onChange | a callback function, can be executed when the checked state changes | (e: Object): void | - |

### Radio.RadioItem

基于`List.Item``Radio`进行封装,`List.Item``extra`属性固定传入`Radio`,其他属性和`List.Item`一致。
其他 API 和 Radio 相同。
The encapsulation about `Radio` based on `List.Item`, the property `extra` of `List.Item` will be passed to `Radio`, while other properties remain the same.

Other APIs are identical with `Radio`.

0 comments on commit 0c09022

Please sign in to comment.