From a0a73cd2f1e823597f7c81d1a118319103ae01c6 Mon Sep 17 00:00:00 2001 From: chenxuan Date: Tue, 3 May 2022 19:49:45 +0800 Subject: [PATCH] xxx --- basic/1/P06_.html | 4 ++-- basic/1/P08.html | 2 +- basic/2/P03.html | 5 +++-- basic/{ex => createClass}/1.html | 0 basic/{ex => createClass}/2.html | 0 basic/{ex => createClass}/3.html | 0 6 files changed, 6 insertions(+), 5 deletions(-) rename basic/{ex => createClass}/1.html (100%) rename basic/{ex => createClass}/2.html (100%) rename basic/{ex => createClass}/3.html (100%) diff --git a/basic/1/P06_.html b/basic/1/P06_.html index df61d87fe..ff4ded1c0 100644 --- a/basic/1/P06_.html +++ b/basic/1/P06_.html @@ -1,7 +1,7 @@ @@ -23,11 +23,11 @@ this.state={ ishot:true } + // 解决this指向问题 this.demo=this.demo.bind(this) } render(){ const {ishot}=this.state; - // 解决this指向问题 return

今天天气很{ishot ? '炎热' : '凉爽'}

} demo(){ diff --git a/basic/1/P08.html b/basic/1/P08.html index 5c61f53ad..38f823bf2 100644 --- a/basic/1/P08.html +++ b/basic/1/P08.html @@ -1,7 +1,7 @@ diff --git a/basic/2/P03.html b/basic/2/P03.html index 66fc4690c..08ca2ee14 100644 --- a/basic/2/P03.html +++ b/basic/2/P03.html @@ -1,7 +1,7 @@ @@ -23,11 +23,12 @@ // 这种写法,更新时不会调用 haha=(c)=>{ this.hehe=c; - console.log("xx") + } change=()=>{ const {ishot}=this.state; this.setState({ishot:!ishot}); + console.log(this.hehe.value) } render(){ const {ishot}=this.state; diff --git a/basic/ex/1.html b/basic/createClass/1.html similarity index 100% rename from basic/ex/1.html rename to basic/createClass/1.html diff --git a/basic/ex/2.html b/basic/createClass/2.html similarity index 100% rename from basic/ex/2.html rename to basic/createClass/2.html diff --git a/basic/ex/3.html b/basic/createClass/3.html similarity index 100% rename from basic/ex/3.html rename to basic/createClass/3.html