-
Notifications
You must be signed in to change notification settings - Fork 1
/
jsx中级.html
57 lines (52 loc) · 1.43 KB
/
jsx中级.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
#root {
text-align: center;
}
.tit {
color: blue;
font-size: 48px;
}
</style>
</head>
<body>
<div id="root">
</div>
<script src="./lib/react.development.js"></script>
<script src="./lib/react-dom.development.js"></script>
<script src="./lib/babel.min.js"></script>
<script type="text/babel">
let stlyes = {
width:"200px",
height:"200px",
color:"#fff",
background:"#666",
fontSize:"24px",
margin:"0 auto",
marginTop:"20px"
}
// function tableContext(n){
// return <div style={stlyes}>内容{n}</div>
// }
function tabBtn(n) {
alert(n)
}
let j = (
<div>
<h3 className="tit">React-Table选项卡</h3>
<input onClick={tabBtn(0)} type="button" value="标题一"/>
<input onClick={tabBtn(1)} type="button" value="标题二"/>
<input onClick={tabBtn(2)} type="button" value="标题三"/>
<div style={stlyes}>内容</div>
</div>
);
ReactDOM.render(j,document.getElementById("root"));
</script>
</body>
</html>