React学习案例二十
<!DOCTYPE html><html><head><meta charset="UTF-8"/><title>菜鸟教程 React 实例</title></head><body><div id="example"></div><script type="text/babel">classWebSite extends React.Component {
constructor(){super();
this.state ={
name:"菜鸟教程",
site:"https://www.runoob.com"}}
render(){return(<div><Name name={this.state.name}/><Link site={this.state.site}/></div>);}}className extends React.Component {
render(){return(<h1>{this.props.name}</h1>);}}classLink extends React.Component {
render(){return(<a href={this.props.site}>{this.props.site}</a>);}}
ReactDOM.render(<WebSite />,
document.getElementById('example'));</script></body></html><!--<!DOCTYPE html><html><head><meta charset="UTF-8"/><title>菜鸟教程 React 实例</title></head><body><div id="example"></div><script type="text/babel">classWebSite extends React.Component {
constructor(){super();
this.state ={
name:"菜鸟教程",
site:"https://www.runoob.com"}}
render(){return(<div><Name name={this.state.name}/><Link site={this.state.site}/></div>);}}className extends React.Component {
render(){return(<h1>{this.props.name}</h1>);}}classLink extends React.Component {
render(){return(<a href={this.props.site}>{this.props.site}</a>);}}
ReactDOM.render(<WebSite />,
document.getElementById('example'));</script></body></html>--><!--<!DOCTYPE html><html><head><meta charset="UTF-8"/><title>菜鸟教程 React 实例</title></head><body><div id="example"></div><script type="text/babel">classWebSite extends React.Component {
constructor(){super();
this.state ={
name:"菜鸟教程",
site:"https://www.runoob.com"}}
render(){return(<div><Name name={this.state.name}/><Link site={this.state.site}/></div>);}}className extends React.Component {
render(){return(<h1>{this.props.name}</h1>);}}classLink extends React.Component {
render(){return(<a href={this.props.site}>{this.props.site}</a>);}}
ReactDOM.render(<WebSite />,
document.getElementById('example'));</script></body></html>--><!--<!DOCTYPE html><html><head><meta charset="UTF-8"/><title>菜鸟教程 React 实例</title></head><body><div id="example"></div><script type="text/babel">classWebSite extends React.Component {
constructor(){super();
this.state ={
name:"菜鸟教程",
site:"https://www.runoob.com"}}
render(){return(<div><Name name={this.state.name}/><Link site={this.state.site}/></div>);}}className extends React.Component {
render(){return(<h1>{this.props.name}</h1>);}}classLink extends React.Component {
render(){return(<a href={this.props.site}>{this.props.site}</a>);}}
ReactDOM.render(<WebSite />,
document.getElementById('example'));</script></body></html>-->
本文转载自: https://blog.csdn.net/m0_54218263/article/details/122769623
版权归原作者 hhh江月 所有, 如有侵权,请联系我们删除。
版权归原作者 hhh江月 所有, 如有侵权,请联系我们删除。