Hou*_*man 17 javascript reactjs react-jsx
我为下表定义了一个类名(作为JSX的一部分).
<table class="table">
但是,一旦显示该类未在表上设置:
var SearchResult = React.createClass({
render: function(){
return (
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Address</th>
</tr>
</thead>
<tbody>...</tbody>
</table>
);
}
});
Run Code Online (Sandbox Code Playgroud)
相反,表格显示<table data-reactid=".0.1.0.0">...</table>在Chrome中 - > inspect元素.
cou*_*and 25
ReactJS使用该属性className来避免使用JavaScript保留字.
<table className="table">
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7592 次 |
| 最近记录: |