xx
This commit is contained in:
+19
-2
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: chenxuan
|
||||
* @Date: 2021-12-26 16:30:03
|
||||
* @LastEditTime: 2021-12-26 16:37:06
|
||||
* @LastEditTime: 2021-12-29 00:19:18
|
||||
* @LastEditors: chenxuan
|
||||
-->
|
||||
<!DOCTYPE html>
|
||||
@@ -17,7 +17,24 @@
|
||||
<script src="./package/old/react-dom.development.js"></script>
|
||||
<script src="./package/old/babel.min.js"></script>
|
||||
<script type="text/babel">
|
||||
|
||||
class Weather extends React.Component{
|
||||
constructor(props){
|
||||
super(props)
|
||||
this.state={
|
||||
ishot:true
|
||||
}
|
||||
}
|
||||
render(){
|
||||
const {ishot}=this.state;
|
||||
return <h1 onClick={demo}>今天天气很{ishot ? '炎热' : '凉爽'}</h1>
|
||||
}
|
||||
}
|
||||
ReactDOM.render(
|
||||
<Weather/>,document.getElementById('app')
|
||||
)
|
||||
function demo(){
|
||||
console.log('xxx')
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user