xx
This commit is contained in:
+2
-1
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: chenxuan
|
||||
* @Date: 2022-01-02 15:24:10
|
||||
* @LastEditTime: 2022-01-02 19:52:21
|
||||
* @LastEditTime: 2022-03-20 14:16:57
|
||||
* @LastEditors: chenxuan
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
@@ -34,5 +34,6 @@
|
||||
<Demo/>,document.getElementById('app')
|
||||
)
|
||||
</script>
|
||||
<!-- 字符串类型的ref有效率问题,不推荐使用 -->
|
||||
</body>
|
||||
</html>
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: chenxuan
|
||||
* @Date: 2022-01-02 22:09:19
|
||||
* @LastEditTime: 2022-01-02 22:31:39
|
||||
* @LastEditTime: 2022-03-20 14:35:58
|
||||
* @LastEditors: chenxuan
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
@@ -23,7 +23,7 @@
|
||||
// 这种写法,更新时不会调用
|
||||
haha=(c)=>{
|
||||
this.hehe=c;
|
||||
console.log(c)
|
||||
console.log("xx")
|
||||
}
|
||||
change=()=>{
|
||||
const {ishot}=this.state;
|
||||
|
||||
+3
-2
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: chenxuan
|
||||
* @Date: 2022-01-02 23:49:08
|
||||
* @LastEditTime: 2022-01-02 23:51:41
|
||||
* @LastEditTime: 2022-03-20 18:20:28
|
||||
* @LastEditors: chenxuan
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
@@ -21,6 +21,7 @@
|
||||
class Demo extends React.Component{
|
||||
myef=React.createRef();
|
||||
getValue=()=>{
|
||||
console.log(this.myef)
|
||||
alert(this.myef.current.value)
|
||||
}
|
||||
render(){
|
||||
@@ -36,6 +37,6 @@
|
||||
<Demo/>,document.getElementById('app')
|
||||
)
|
||||
</script>
|
||||
|
||||
<!-- 该容器专人专用,只能存1个 -->
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user