Skip to content

Commit

Permalink
fix(nav-bar): 修改默认函数
Browse files Browse the repository at this point in the history
  • Loading branch information
jimczj committed Aug 1, 2018
1 parent a38da87 commit 073fbff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
24 changes: 12 additions & 12 deletions src/components/nav-bar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ class AtNavBar extends Taro.Component {
handleClickLeftView () {
this.props.onClickLeftIcon(...arguments)
}
handleClickFirstIcon () {
this.props.onClickRightFirstIcon(...arguments)
handleClickSt () {
this.props.onClickRgIconSt(...arguments)
}
handleClickSecondIcon () {
this.props.onClickRightSecondIcon(...arguments)
handleClickNd () {
this.props.onClickRgIconNd(...arguments)
}

render () {
Expand All @@ -40,18 +40,18 @@ class AtNavBar extends Taro.Component {
</View>
<View className='at-nav-bar__title'>{title}</View>
<View className='at-nav-bar__right_view'>
<View className='at-nav-bar__container' style={linkStyle} onClick={this.handleClickFirstIcon.bind(this)}>
<View className='at-nav-bar__container' style={linkStyle} onClick={this.handleClickSt.bind(this)}>
<AtIcon value={rightFirstIconType} />
</View>
<View className='at-nav-bar__container' style={linkStyle} onClick={this.handleClickSecondIcon.bind(this)}>
<View className='at-nav-bar__container' style={linkStyle} onClick={this.handleClickNd.bind(this)}>
<AtIcon value={rightSecondIconType} />
</View>
</View>
</View>
}
}

const defaltFunc = () => {}
const defaultFunc = () => {}

AtNavBar.defaultProps = {
fixed: false,
Expand All @@ -61,9 +61,9 @@ AtNavBar.defaultProps = {
title: '',
rightFirstIconType: '',
rightSecondIconType: '',
onClickLeftIcon: defaltFunc,
onClickRightFirstIcon: defaltFunc,
onClickRightSecondIcon: defaltFunc
onClickLeftIcon: defaultFunc,
onClickRgIconSt: defaultFunc,
onClickRgIconNd: defaultFunc
}
AtNavBar.propTypes = {
fixed: PropTypes.bool,
Expand All @@ -74,7 +74,7 @@ AtNavBar.propTypes = {
rightFirstIconType: PropTypes.string,
rightSecondIconType: PropTypes.string,
onClickLeftIcon: PropTypes.func,
onClickRightFirstIcon: PropTypes.func,
onClickRightSecondIcon: PropTypes.func
onClickRgIconSt: PropTypes.func,
onClickRgIconNd: PropTypes.func
}
export default AtNavBar
12 changes: 6 additions & 6 deletions src/pages/navigation/nav-bar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default class Index extends Taro.Component {
<View className='item'>
<AtNavBar
onClickLeftIcon={this.handleClick.bind(this, '点击左边')}
onClickRightFirstIcon={this.handleClick.bind(this, '点击右边1')}
onClickRightSecondIcon={this.handleClick.bind(this, '点击右边2')}
onClickRgIconSt={this.handleClick.bind(this, '点击右边1')}
onClickRgIconNd={this.handleClick.bind(this, '点击右边2')}
title='nav bar 导航栏 示例'
leftIconType='return'
leftText='返回'
Expand All @@ -32,8 +32,8 @@ export default class Index extends Taro.Component {
<View className='item'>
<AtNavBar
onClickLeftIcon={this.handleClick.bind(this, '点击左边')}
onClickRightFirstIcon={this.handleClick.bind(this, '点击右边1')}
onClickRightSecondIcon={this.handleClick.bind(this, '点击右边2')}
onClickRgIconSt={this.handleClick.bind(this, '点击右边1')}
onClickRgIconNd={this.handleClick.bind(this, '点击右边2')}
title='nav bar 导航栏'
leftIconType='return'
rightFirstIconType='group'
Expand All @@ -43,8 +43,8 @@ export default class Index extends Taro.Component {
<View className='item'>
<AtNavBar
onClickLeftIcon={this.handleClick.bind(this, '点击左边')}
onClickRightFirstIcon={this.handleClick.bind(this, '点击右边1')}
onClickRightSecondIcon={this.handleClick.bind(this, '点击右边2')}
onClickRgIconSt={this.handleClick.bind(this, '点击右边1')}
onClickRgIconNd={this.handleClick.bind(this, '点击右边2')}
color='#000'
title='nav bar导航栏 示例'
leftIconType='return'
Expand Down

0 comments on commit 073fbff

Please sign in to comment.