极简触感反馈Button组件

时间:2023-12-10 11:13:08

一个简单的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;
}
}