<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                - 1.子組件的屬性接收一個父組件的方法 - 2.在子組件中,調用這個方法,向父組件傳參 ~~~ //1.子組件 import React,{Component} from 'react'; class TodoItem extends Component { constructor(props){ super(props); this.handleClick = this.handleClick.bind(this) } render(){ return ( <div onClick={this.handleClick}> {this.props.content} {this.props.index} </div> ) } handleClick(){ this.props.deleteItem(this.props.index) } } export default TodoItem ~~~ ~~~ //2.父組件 import React, { Component} from 'react'; import './index.css'; import TodoItem from './components/TodoItem'; class App extends Component { constructor(props) { super(props); this.state ={ list:[1,2,3] } } render() { return ( <div> {this.state.list.map((item,index)=>{ return <TodoItem key={index} content={item} index={index} //向子組件傳遞一個事件 deleteItem={this.handleDelete.bind(this)} ></TodoItem> })} </div> ) } handleDelete(index){ var list = this.state.list; list.splice(index,1); this.setState({ list:list }) } } export default App; ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看