JSX语法总结
1.定义虚拟DOM时 不能用引号
const element = <h1>Hello, world!</h1>;
2,标签中混入js表达式时要用{}
const name = 'Josh Perez';
const element = <h1>Hello, {name}</h1>;
3,样式中类名指定 不能使用class 需要使用ClassName
<div className='head'>hello<div/>
原创
2021-11-15 13:26:15 ·
718 阅读 ·
0 评论