-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path03-003-index.html
61 lines (50 loc) · 1.68 KB
/
03-003-index.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
58
59
60
61
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<script src="http://fb.me/react-with-addons-0.11.1.js"></script>
<script src="http://fb.me/JSXTransformer-0.11.1.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js"></script>
<title>Held you for a little while</title>
</head>
<body>
<!-- container node-->
<div id="app"></div>
<!-- container node-->
<div id="dom"></div>
<script type="text/jsx">
/** @jsx React.DOM */
var App = React.createClass({
mixins: [React.addons.LinkedStateMixin],
getInitialState: function(){
return {
payment: 0,
payment2: 0
};
},
render: function() {
var total = parseInt(this.state.payment, 10) + parseInt(this.state.payment2, 10);
return (
<div>
<Payment valueLink={this.linkState('payment')} />
<Payment valueLink={this.linkState('payment2')} />
{total}
</div>
);
}
});
var Payment = React.createClass({
render: function(){
return this.transferPropsTo(
<input type="text" />
);
}
});
React.renderComponent(
<App />,
document.getElementById('app')
);
</script>
</body>
</html>