reactjs – onmouseover不使用React.js

前端之家收集整理的这篇文章主要介绍了reactjs – onmouseover不使用React.js前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
click事件工作正常,但onmouSEOver事件不起作用.
ProfImage = React.createClass({

    getInitialState: function() {
        return { showIcons: false };
    },onClick: function() {

        if(this.state.showIcons == true) {
            this.setState({ showIcons: false });
        }
        else {
            this.setState({ showIcons: true });
        }
    },onHover: function() {
        this.setState({ showIcons: true });
    },render: function() {

        return (
            <div>
            <span className="major">
                <img src="/images/profile-pic.png" height="100" onClick={this.onClick} onmouSEOver={this.onHover} />
            </span>


            { this.state.showIcons ? <SocialIcons /> : null }
            </div>

        );
    }

});
你需要将一些字母大写.
<img src="/images/profile-pic.png" height="100" onClick={this.onClick} onMouSEOver={this.onHover} />
原文链接:https://www.f2er.com/react/301141.html

猜你在找的React相关文章