react 初始
import React, { Component } from 'react' import "./footer.css" ; //引入外部样式表 export default class footer extends Component { //这里的extends继承父类的属性和方法,但是没有自己的属性和方法 constructor(props) { super (props); this .state = { num: 10 } // this.num = 1; this .show9 = this .show9.bind( this ); // this.show9 = this.show9.apply(this); //用call和apply会直接调用函数页面刷新时就会调用show9 console.log( this , this .show9); } show4() { alert(1111 + "声明的函数show" ); } show5 = () => { alert( this .state.num + "声明的箭头函数" ); } show7 = (content) => { alert(content + "带参数的箭头函数" ); } show8 = () => { alert( "bind函数" ); } show9() { alert( this