reactjs – onmouseover不使用React.js
发布时间:2020-12-15 20:51:14 所属栏目:百科 来源:网络整理
导读:click事件工作正常,但onmouSEOver事件不起作用. ProfImage = React.createClass({ getInitialState: function() { return { showIcons: false }; },onClick: function() { if(this.state.showIcons == true) { this.setState({ showIcons: false }); } else
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} /> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |