0


React学习案例二十四

React学习案例二十四

classLoggingButton extends React.Component {// 这个语法确保了 `this` 绑定在  handleClick 中
    // 这里只是一个测试
    handleClick =()=>{
      console.log('this is:', this);}
   
    render(){return(<button onClick={this.handleClick}>
          Click me
        </button>);}}<!--classLoggingButton extends React.Component {// 这个语法确保了 `this` 绑定在  handleClick 中
  // 这里只是一个测试
  handleClick =()=>{
    console.log('this is:', this);}
 
  render(){return(<button onClick={this.handleClick}>
        Click me
      </button>);}}--><!--classLoggingButton extends React.Component {// 这个语法确保了 `this` 绑定在  handleClick 中
  // 这里只是一个测试
  handleClick =()=>{
    console.log('this is:', this);}
 
  render(){return(<button onClick={this.handleClick}>
        Click me
      </button>);}}--><!--classLoggingButton extends React.Component {// 这个语法确保了 `this` 绑定在  handleClick 中
  // 这里只是一个测试
  handleClick =()=>{
    console.log('this is:', this);}
 
  render(){return(<button onClick={this.handleClick}>
        Click me
      </button>);}}--><!--classLoggingButton extends React.Component {// 这个语法确保了 `this` 绑定在  handleClick 中
  // 这里只是一个测试
  handleClick =()=>{
    console.log('this is:', this);}
 
  render(){return(<button onClick={this.handleClick}>
        Click me
      </button>);}}--><!--classLoggingButton extends React.Component {// 这个语法确保了 `this` 绑定在  handleClick 中
  // 这里只是一个测试
  handleClick =()=>{
    console.log('this is:', this);}
 
  render(){return(<button onClick={this.handleClick}>
        Click me
      </button>);}}-->

本文转载自: https://blog.csdn.net/m0_54218263/article/details/122821726
版权归原作者 hhh江月 所有, 如有侵权,请联系我们删除。

“React学习案例二十四”的评论:

还没有评论