mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 21:08:55 +08:00
拆出来方便编辑器实现
This commit is contained in:
parent
eb7ddffb73
commit
c9b4d13f1f
@ -21,18 +21,23 @@ export interface ButtonToolbarProps
|
||||
export class ButtonToolbarControl extends React.Component<ButtonToolbarProps> {
|
||||
static defaultProps = {};
|
||||
|
||||
renderButtons() {
|
||||
const {render, classPrefix: ns, buttons} = this.props;
|
||||
return Array.isArray(buttons)
|
||||
? buttons.map((button, key) =>
|
||||
render(`button/${key}`, button, {
|
||||
key: key
|
||||
})
|
||||
)
|
||||
: null;
|
||||
}
|
||||
|
||||
render() {
|
||||
const {render, className, classPrefix: ns, buttons} = this.props;
|
||||
|
||||
return (
|
||||
<div className={cx(`${ns}ButtonToolbar`, className)}>
|
||||
{Array.isArray(buttons)
|
||||
? buttons.map((button, key) =>
|
||||
render(`button/${key}`, button, {
|
||||
key: key
|
||||
})
|
||||
)
|
||||
: null}
|
||||
{this.renderButtons()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user