📜  类组件内的函数反应 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:04:01.303000             🧑  作者: Mango

代码示例1
export default class Archive extends React.Component { 

    saySomething(something) {
        console.log(something);
    }

    handleClick(e) {
        this.saySomething("element clicked");
    }

    componentDidMount() {
        this.saySomething("component did mount");
    }

    render() {
        return