Button.jsx 669 B

12345678910111213141516171819202122
  1. import React, { Component } from 'react';
  2. import { Button, WhiteSpace, WingBlank } from 'antd-mobile';
  3. // import { genPercentAdd } from 'antd/lib/upload/utils';
  4. export default class Buttons extends Component{
  5. constructor(props){
  6. super(props)
  7. this.state={
  8. buttonStyle:{
  9. background:"green",
  10. margin:'0 10px'
  11. }
  12. }
  13. }
  14. render(){
  15. return (
  16. <WingBlank>
  17. <Button type="primary" style={this.state.buttonStyle} onClick={()=>this.props.changePage(this.props.toPage)}>{this.props.buttonText}</Button><WhiteSpace />
  18. </WingBlank>
  19. )
  20. }
  21. }