Skip to content

Commit 4d854e0

Browse files
committed
feat(SplitButton): add leftButtonProps
1 parent 2f608d9 commit 4d854e0

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

docs/split-button/index.en-us.md

+2
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ SplitButton is kind of GroupButton, only the icon part could be trigerred by use
3737
| popupStyle | Custom style of popup | Object | - |
3838
| popupClassName | Custom className of popup | String | - |
3939
| popupProps | Props of popup | Object | {} |
40+
| menuProps | Props of Menu | Object | {} |
41+
| leftButtonProps | Props of left button | Object | {} |

docs/split-button/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ SplitButton 同样由 Button 和 Menu 组成,其在触发区域上可以分为
3939
| popupClassName | 弹层自定义样式类 | String | - |
4040
| popupProps | 透传给弹层的属性 | Object | - |
4141
| menuProps | 透传给 Menu 的属性 | Object | {} |
42+
| leftButtonProps | 透传给 左侧按钮 的属性 | Object | {} |

src/split-button/index.jsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ class SplitButton extends React.Component {
104104
* 透传给 Menu 的属性
105105
*/
106106
menuProps: PropTypes.object,
107+
/**
108+
* 透传给 左侧按钮 的属性
109+
*/
110+
leftButtonProps: PropTypes.object,
107111
className: PropTypes.string,
108112
children: PropTypes.any,
109113
};
@@ -119,6 +123,7 @@ class SplitButton extends React.Component {
119123
onSelect: func.noop,
120124
defaultSelectedKeys: [],
121125
menuProps: {},
126+
leftButtonProps: {},
122127
};
123128

124129
constructor(props, context) {
@@ -213,6 +218,7 @@ class SplitButton extends React.Component {
213218
popupProps,
214219
selectMode,
215220
menuProps,
221+
leftButtonProps,
216222
disabled,
217223
...others
218224
} = this.props;
@@ -243,7 +249,7 @@ class SplitButton extends React.Component {
243249

244250
return (
245251
<Button.Group {...obj.pickOthers(SplitButton.propTypes, others)} className={classNames} style={style} size={size} ref={this._wrapperRefHandler}>
246-
<Button {...sharedBtnProps}>{label}</Button>
252+
<Button {...sharedBtnProps} {...leftButtonProps}>{label}</Button>
247253
<Popup
248254
{...popupProps}
249255
visible={state.visible}

0 commit comments

Comments
 (0)