index.sjs 545 B

123456789101112131415161718192021222324
  1. function getClass(size) {
  2. var list = ['small', 'medium', 'large'];
  3. if (list.indexOf(size) >= 0) {
  4. return "ant-button-".concat(size);
  5. }
  6. return 'ant-button-medium';
  7. }
  8. function getHoverClass(loading, type, activeClassName) {
  9. if (loading) {
  10. return '';
  11. }
  12. var className = 'ant-button-active';
  13. if (type === 'text') {
  14. className += ' ant-button-text-active';
  15. }
  16. if (activeClassName) {
  17. className += ' ' + activeClassName;
  18. }
  19. return className;
  20. }
  21. export default {
  22. getClass: getClass,
  23. getHoverClass: getHoverClass
  24. };