Files
react/basic/1/P01_1.html
T
2022-05-01 19:27:52 +08:00

45 lines
1.1 KiB
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.
<!--
* @Author: chenxuan
* @Date: 2021-12-23 21:52:33
* @LastEditTime: 2022-01-11 15:20:32
* @LastEditors: chenxuan
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>绑定内联样式</title>
<script src="../package/old/react.development.js"></script>
<script src="../package/old/react-dom.development.js"></script>
<script src="../package/old/babel.min.js"></script>
<style type="text/css">
.haha{
color: red;
}
</style>
</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>