Skip to content

Commit

Permalink
stepper translation, ref #329
Browse files Browse the repository at this point in the history
  • Loading branch information
silentcloud committed May 9, 2017
1 parent ee84076 commit 4b6752a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ exports[`renders ./components/stepper/demo/basic.tsx correctly 1`] = `
]
}
>
禁用
Disabled
</Text>
</View>
<View
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`renders ./components/stepper/demo/basic.md correctly 1`] = `
<div
class="am-list-header"
>
演示
Demos
</div>
<div
class="am-list-body"
Expand All @@ -21,7 +21,7 @@ exports[`renders ./components/stepper/demo/basic.md correctly 1`] = `
<div
class="am-list-content"
>
显示数值(默认使用 TouchEvent, for Mobile)
Show number value(Use TouchEvent for mobile by default)
</div>
<div
class="am-list-extra"
Expand Down Expand Up @@ -96,7 +96,7 @@ exports[`renders ./components/stepper/demo/basic.md correctly 1`] = `
<div
class="am-list-content"
>
显示数值(使用 MouseEvent, for PC)
Show number value(Use MouseEvent for PC by default)
</div>
<div
class="am-list-extra"
Expand Down Expand Up @@ -171,7 +171,7 @@ exports[`renders ./components/stepper/demo/basic.md correctly 1`] = `
<div
class="am-list-content"
>
禁用
Disabled
</div>
<div
class="am-list-extra"
Expand Down
11 changes: 4 additions & 7 deletions components/stepper/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ title:
en-US: Basic
---

数字输入框。


````jsx
import { List, Stepper } from 'antd-mobile';

Expand All @@ -29,15 +26,15 @@ class Demo extends React.Component {
}
render() {
return (
<List renderHeader={() => '演示'}>
<List renderHeader={() => 'Demos'}>
<List.Item extra={
<Stepper
style={{ width: '100%', minWidth: '2rem' }}
showNumber max={10} min={1} value={this.state.val} onChange={this.onChange}
/>}
wrap
>
显示数值(默认使用 TouchEvent, for Mobile)
Show number value(Use TouchEvent for mobile by default)
</List.Item>
<List.Item extra={
<Stepper
Expand All @@ -47,15 +44,15 @@ class Demo extends React.Component {
/>}
wrap
>
显示数值(使用 MouseEvent, for PC)
Show number value(Use MouseEvent for PC by default)
</List.Item>
<List.Item extra={
<Stepper
style={{ width: '100%', minWidth: '2rem' }}
showNumber max={10} min={1} defaultValue={3} disabled
/>}
>
禁用
Disabled
</List.Item>
</List>
);
Expand Down
2 changes: 1 addition & 1 deletion components/stepper/demo/basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class StepperExample extends React.Component<any, any> {
</List.Item>
<List.Item extra={readOnly} >readOnly: false</List.Item>
<List.Item extra={<Stepper key="2" disabled max={10} min={1} defaultValue={3} onChange={onChange} />}>
禁用
Disabled
</List.Item>
</List>
</View>
Expand Down
26 changes: 13 additions & 13 deletions components/stepper/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ type: Data Entry
title: Stepper
---

用作增加或者减少当前数值。
`Stepper` can be used to increase or decrease value step by step.

### 规则
- 当想要对数值进行小幅度调整时,可以使用 Stepper,eg:将年化收益从 4.00% 调整到 4.05%
### Rule
- When you want to make small adjustments to the value, you can use `Stepper`. eg: Adjust the annual return from 4.00% to 4.05%.

## API

Support WEB, React-Native.

Properties | Descrition | Type | Default
-----------|------------|------|--------
| min | 最小值 | Number | -Infinity |
| max | 最大值 | Number | Infinity |
| value | 当前值 | Number | |
| step | 每次改变步数,可以为小数 | Number or String | 1 |
| defaultValue | 初始值 | Number | |
| onChange | 变化时回调函数 | (): void | |
| disabled | 禁用 | Boolean | false |
| readOnly | input 只读 | Boolean | false |
| showNumber(`web only`) | 是否显示数值,默认不显示 | Boolean | false |
| styles(`rn only`) | react native 组件样式 | ReactNative StyleSheet | - |
| min | Specifies the minimum value | Number | -Infinity |
| max | Specifies the maximum value | Number | Infinity |
| value | Specifies the value of the `Stepper` | Number | |
| step | Specifies the legal number intervals | Number or String | 1 |
| defaultValue | Specifies the defaultValue of the `Stepper` | Number | |
| onChange | Called when value of the `Stepper` changed | (): void | |
| disabled | Specifies the `Stepper` should be disabled | Boolean | false |
| readOnly | Specifies the `Stepper` is read only | Boolean | false |
| showNumber(`web only`) | Whether to display number value | Boolean | false |
| styles(`rn only`) | the styles of React-Native component | ReactNative StyleSheet | - |

0 comments on commit 4b6752a

Please sign in to comment.