Skip to content

Commit

Permalink
feat(PickerHeader): 支持 renderTitle
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Aug 31, 2019
1 parent 8826049 commit fe790c5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/Picker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function MPicker(props: MPickerProps) {
<View className='m-picker'>
<MPickerHeader
{...props}
renderTitle={props.renderTitle}
onCancel={handleCancelClick}
onConfirm={handleConfirmClick}
/>
Expand Down
1 change: 1 addition & 0 deletions src/components/PickerHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function MPickerHeader(props: MPickerHeaderProps) {
</View>
<View className='m-picker-header__title'>
{props.title}
{props.renderTitle}
</View>
<View
className='m-picker-header__confirm'
Expand Down
5 changes: 5 additions & 0 deletions src/components/PickerHeader/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ export const MPickerHeaderDefaultProps = createProps({
*/
title: '' as string,

/**
* 自定义标题。
*/
renderTitle: null as React.ReactNode,

/**
* 是否无取消按钮。
*
Expand Down

0 comments on commit fe790c5

Please sign in to comment.