This commit is contained in:
2021-12-23 23:59:39 +08:00
parent 15167fe687
commit 9712f00e9a
3 changed files with 72 additions and 2 deletions
+15 -2
View File
@@ -1,9 +1,15 @@
<!--
* @Author: chenxuan
* @Date: 2021-12-23 21:52:33
* @LastEditTime: 2021-12-23 23:44:20
* @LastEditors: chenxuan
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<title>JSX语法</title>
<style type="text/css">
.haha{
color: red;
@@ -19,7 +25,7 @@
const text="hello world!";
const vdom=(
<div className="haha">
<h1>{text}</h1>
<li style={{fontSize:'48px',fontWeight:'bold'}}>{text}</li>
</div>
);
ReactDOM.render(
@@ -27,6 +33,13 @@
)
console.log(vdom);
console.log(document.getElementById('app'))
/*
*1、根元素
*2、闭合标签
*3、js使用{}
*4、内联样式使用{{}}
*5、className
*/
</script>
</body>
</html>