直播软件源码,好看的点赞按钮
<div id="mountNode"></div>
class Button extends React.Component {
state = {
starred: false,
};
handleClick() {
this.setState ({
...this.state,
starred: !this.state.starred,
});
};
render() {
return (
<button className={`button ${this.state.starred?'stared':''}`} onClick={this.handleClick.bind(this)}>
<span className="icon">icon</span>
<div className='heart-animation-1' key="animation-1" />
<div className='heart-animation-2' key="animation-2" />
</button>
)
}
}
ReactDOM.render(<Button >按钮</Button>, mountNode);
以上就是直播软件源码,好看的点赞按钮, 更多内容欢迎关注之后的文章
标签:点赞,state,直播,按钮,starred,源码 From: https://www.cnblogs.com/yunbaomengnan/p/17358748.html