React 组件

react

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="js/react.js"></script>
<script src="js/react-dom.js"></script>
<script src="js/browser.min.js"></script>
</head>
<body>
<div >

var TitleComponent = React.createClass({
render:function(){
return <h1> Web</h1>;
}
})

var InfoComponent = React.createClass({
render:function(){
return <p> it is a good class </p>
}
})

var ComplexComponent = React.createClass({
render:function(){
return <div>
<TitleComponent/>
<InfoComponent/>
</div>
}
})

ReactDOM.render(
<ComplexComponent/>,
document.getElementById('example')
)
</script>
</body>
</html>

以上是 React 组件 的全部内容, 来源链接: utcz.com/z/383233.html

回到顶部