import React,{Component} from 'react';
import './index.less'
import { Button } from 'antd';
import {withRouter} from 'react-router-dom'

@withRouter 
export default class BTitle extends Component {
    constructor(props){
        super(props);
    }
    goback = ()=>{
        this.props.history.goBack();
    }
    render() {
        let dom = '';
        if(this.props.hasBack){
            dom = (<Button onClick={this.goback}>返回</Button>)
        }
        return(
            <div>
				<h2 className="btitle">{this.props.btitle}<span className='backbtn'>{dom}</span></h2>
			</div>
        )
    }
}