Skip to content

Commit

Permalink
city_picker receive lang props
Browse files Browse the repository at this point in the history
  • Loading branch information
lmxxxx committed Dec 27, 2016
1 parent 21c7ade commit 4120ddc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions example/pages/picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class PickerDemo extends React.Component {
onCancel={e=>this.setState({city_show: false})}
onChange={text=>this.setState({city_value: text, city_show: false})}
show={this.state.city_show}
lang={{leftBtn: '取消', rightBtn: '确定'}}
/>


Expand Down
8 changes: 7 additions & 1 deletion src/components/picker/city_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ class CityPicker extends React.Component {
* display the component
*
*/
show: PropTypes.bool
show: PropTypes.bool,
/**
* language object consists of `leftBtn` and `rightBtn`
*
*/
lang: PropTypes.object,
}

static defaultProps = {
Expand Down Expand Up @@ -126,6 +131,7 @@ class CityPicker extends React.Component {
defaultSelect={this.state.selected}
groups={this.state.groups}
onCancel={this.props.onCancel}
lang={this.props.lang}
/>
)
}
Expand Down

0 comments on commit 4120ddc

Please sign in to comment.