react headtop title 截取

render() {
    const nav = this.props.nav
    const text = nav && nav.length > 5 ? this.strHandle(nav,5)+'......' : nav;
    return (
       <div className="navhead" onClick={this.props.onHandle}>
        <NavBar
	      mode="dark"
	      icon={<Icon type="left" />}
      	  onLeftClick={() => window.history.back() }
        leftContent="返回"
        style={{background:'#c7010f'}}
	    >{ text }</NavBar>
      </div>
    );
  }

  

原文地址:https://www.cnblogs.com/winyh/p/8124188.html