2016-07-24 10 views

Antwort

1

können Sie window.location.href = `mailto:${this.props.email}`

class EmailButton extends Component { 
    constructor(props){ 
     super(props); 
     this.onClick = this.onClick.bind(this); 
    } 
    onClick(){ 
     window.location.href = `mailto:${this.props.email}`; 
    } 
    render(){ 
     return <button onClick={this.onClick}>EmailButton</button>; 
    } 
} 

webpackbin demo

auch können Sie <a href={`mailto:${email}`}>EmailButton</a>

+0

Sie danken verwenden verwenden !!!! Wirklich geholfen –