All files / src/components/Tooltip index.js

0% Statements 0/10
100% Branches 0/0
100% Functions 0/0
0% Lines 0/10
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46                                                                                           
/**
 * @Component Tooltip
 * @Type 文字提示组件
 * @Author 瞿龙俊 - qulongjun@shine.design
 * @Date 2019-04-27 11:59
 */
import React, {PureComponent} from 'react';
import classNames from 'classnames';
import * as PropTypes from 'prop-types';
import './style/index.scss';
 
class Tooltip extends PureComponent {
 
  render() {
    const {className, attributes, children} = this.props;
 
    /** 计算样式 */
    const classes = classNames(
      className,
    );
 
    return (
      <div
        className={classes}
        {...attributes}
      >
        {children}
      </div>
    );
  }
}
 
Tooltip.propTypes = {
  /** 用户自定义修饰符 */
  className: PropTypes.string,
  /** 用户自定义属性 */
  attributes: PropTypes.object,
};
 
Tooltip.defaultProps = {
  className: '',
  attributes: {},
};
 
export default Tooltip;