Files
react/basic/1基础/4.html
T
2021-05-16 12:31:41 +08:00

36 lines
1019 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en" dir="ltr">
<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>绑定内联样式</title>
<script src="../reactjs/bower_components/react/react.js"></script>
<script src="../reactjs/bower_components/react/react-dom.js"></script>
<script src="../reactjs/bower_components/babel/browser.js"></script>
</head>
<body>
<div id="app">
<script type="text/babel">
let j=100,k=200;
var style1={
color:'red',
fontSize:'20px',
fontWeight:'bold'
};
ReactDOM.render(
<ul>
<li>j:{j}</li>
<li>k:{k}</li>
<li style={style1}>j+k:{j+k}</li>
<li>j是否大于k:{
(j>k) ? "是" :"否"
}</li>
</ul>
,document.getElementById('app')
)
</script>
</div>
</body>
</html>