forked from RubyLouvre/anu
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex4.html
More file actions
49 lines (38 loc) · 961 Bytes
/
index4.html
File metadata and controls
49 lines (38 loc) · 961 Bytes
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<!--<script src="./coverage/react.development.js"></script>-->
<script type='text/javascript' src="./dist/ReactSelection.js"></script>
<!--<script src="./test/react-lite.js"></script>-->
<script type='text/javascript' src="./lib/babel.js"></script>
<script type='text/babel'>
class App extends React.Component {
constructor(props){
super(props)
this.state = {
value: 111
}
}
change(e){
console.log(e.target.innerHTML)
this.setState({
value: e.target.innerHTML
})
}
render(){
return (
<div contentEditable={true} onInput={ this.change.bind(this) } >{this.state.value}
</div>
);
}
}
ReactDOM.render(<App />, document.getElementById('example'))
</script>
</head>
<body>
<div>开发者工具</div>
<div id='example'></div>
</body>
</html>