This commit is contained in:
2022-03-28 23:42:42 +08:00
parent 2d1539ced3
commit 2eaac48433
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
<!--
* @Author: chenxuan
* @Date: 2022-01-02 21:23:11
* @LastEditTime: 2022-01-02 22:31:28
* @LastEditTime: 2022-03-28 23:24:12
* @LastEditors: chenxuan
-->
<!DOCTYPE html>
@@ -18,7 +18,7 @@
<script src="../package/old/babel.min.js"></script>
<script type="text/babel">
class Demo extends React.Component{
haha=()=>{
haha1=()=>{
const {haha}=this;
alert(haha.value);
}
@@ -27,7 +27,7 @@
<div>
{/*这种内联函数,更新会多次调用 时有bug */}
<input type="text" ref={c=>this.haha=c}/>
<button onClick={this.haha}>点我</button>
<button onClick={this.haha1}>点我</button>
</div>
)
}