📜  在反应中定义函数 - Javascript 代码示例

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

代码示例2
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