UNPKG

joywok-material-components

Version:

<h1 align="center"> Joywok Material Components </h1>

54 lines (52 loc) 1.31 kB
/** * * @api {} 默认按钮 * @apiName 按钮组件 * @apiGroup 组件使用 * * @apiSuccessExample {json} 使用案例: *import Button from "joywok-material-components/lib/button/normal"; <Button style={{background:"#32a62e"}}>12312312</Button> * * */ import React from 'react'; import { withStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles'; import Button from '@material-ui/core/Button'; const styles = { container: { display: 'flex' }, button:{ paddingLeft: "10px", paddingRight: "10px", color:"#ffffff", textTransform:"none" } }; class CustomButton extends React.Component { constructor(props) { super(props); this.state = { } } render() { let self = this; const { classes } = this.props; this.props.className = classes.input+' jw-custom-button ' + (this.props.className || ''); return ( <div className={'jw-custom-button-w'}> <Button {...this.props} style={Object.assign({ "padding":"4px 12px", "color":"#ffffff", textTransform:"none", "fontSize":"13px" },this.props.style || {})} >{this.props.children}</Button> </div> ); } componentDidMount(){ } } export default withStyles(styles)(CustomButton);