Home.js
import React, {Component,Fragment} from react;
import ImgA from "../assset/index.jpg"
class Home extends Component {render() {return (<Fragment><div>你好我是组件{parseInt(Math.random()*10)}</div><div>你好我是组件2…
Home,js
import React, {Component} from react;
import News from "./News";
class Home extends Component {constructor(props) {super(props);this.state{text:我是默认值}}dataFun(text)>{console.log(text)this.setState({text})}render() {return (<di…
1,对于一个基本的for循环,顺序输出变量值。 for(var i 1; i < 4; i){console.log(i);//结果不多说了吧} 2,如果for循环中有定时器,如下代码。 for (var i 1; i < 4; i) {setTimeout(function() {console.log(i);//3个4}, …
Home,js
import React, {Component} from react;
import News from "./News";
class Home extends Component {constructor(props) {super(props);this.state{text:我是默认值}}dataFun(text)>{console.log(text)this.setState({text})}render() {return (<di…