当前位置:网站首页>1-6 state and binding events
1-6 state and binding events
2022-07-28 23:59:00 【Endless cakes】
React I have uploaded the dependent package to the following address :https://download.csdn.net/download/weixin_39162041/86264167
<script type="text/babel" > /* Be sure to write here babel */
class Wather extends React.Component{
constructor(props){
// Three elements of examples props
//1. Inherited attributes , Must call super()
//2.state The default is an empty object 、
//3. Use curly braces to bind events to elements . Don't put parentheses , Try to be a swordsman document.getElementById The use of this method
super(props)
this.state = {isHot:true}
}
render(){
return <h1 onClick={demo}> It's very... Today {this.state.isHot ?' scorching hot ':' cool '}</h1>
}
}
ReactDOM.render(<Wather/>,document.getElementById('test'))
function demo(){
console.log(' By clicking the ');
}
</script>
边栏推荐
- Working principle of fastdfs (technical principle)
- Best practices for migration of kingbasees v8.3 to v8.6 of Jincang database (2. Compatibility of kingbasees v8.3 and v8.6)
- Wildcard ssl/tls certificate
- Worthington - chemical properties and related studies of Worthington trypsin
- Worthington核糖核酸测定详细攻略
- SAP temporary tablespace error handling
- 器利而工善,以RPA+LCAP赋能企业司库管理数字化升级
- 齐博建站指南(艾戈勒)
- fastdfs工作原理(技术原理)
- 【C】喝汽水,找单身狗问题
猜你喜欢

YOLOV5学习笔记(一)——原理概述

电商数据模型设计

Worthington核糖核酸酶B历史和化学性质说明

SAP temporary tablespace error handling

通配符 SSL/TLS 证书

【C】atoi和offsetof的介绍和模拟实现

EN 1873 assembly accessories for roofing - plastic single roof lamps - CE certification

Machine learning problem notes

SAP oracle 复制新实例后数据库远程连接报错 ora-01031

多传感器融合定位(三)——惯性技术
随机推荐
请简述list,set,map类型的集合的各自特点(简述三种不同的继承方式下)
【MySQL 8】Generated Invisible Primary Keys(GIPK)
Machine learning problem notes
Codeforces Round #810 (Div. 2) A - C
C language n*n matrix evaluation and inverse matrix [easy to understand]
Please briefly describe the respective characteristics of list, set and map type sets (briefly describe three different inheritance methods)
hutool官网(hutool好用吗)
1-7 解决类中方法的this指向问题
GhostNets on Heterogeneous Devices via Cheap Operations
PowerCLi 批量添加esxi到vCenter
【C】逆序字符串(俩种递归思路)
Websocket heartbeat mechanism (keep alive mechanism)
Genomic DNA isolation Worthington ribonuclease A
使用Pytorch快速训练网络模型
Worthington核糖核酸测定详细攻略
pip镜像下载
YOLOV5学习笔记(一)——原理概述
The failure rate is as high as 80%. How to correctly complete the strategic planning of digital transformation?
Deep analysis of integrated learning xgboost
C语言 n*n矩阵求值及求逆矩阵[通俗易懂]