首页 > 其他 > 详细

极简触感反馈Button组件

时间:2019-11-15 15:16:32      阅读:74      评论:0      收藏:0      [点我收藏+]

一个简单的React触感反馈的button组件

import React from 'react';
import './index.scss';

class Button extends React.Component {
    static defaultProps = {
        className: '',
        children: null
    }

    render() {
        const {className, children, ...rest} = this.props;

        return <button className={`feedback-btn ${className}`} {...rest}>
            {children}
        </button>
    }
}

export default Button;
@charset 'utf-8';

.feedback-btn {
    outline: none;
    border: none;
    background-color: transparent;
    font-weight: inherit;
    text-align: inherit;

    &:active {
        opacity: 0.6;
    }
}

极简触感反馈Button组件

原文:https://www.cnblogs.com/ljwk/p/11866011.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!