UNPKG

uicd

Version:

构建 Web 界面组件库 uic

27 lines (26 loc) 895 B
import React from 'react'; import classNames from 'classnames'; var Button = function (props) { var _a; var btnType = props.btnType, children = props.children, size = props.size, disabled = props.disabled, href = props.href; // btn btn-lg btn-primary var classes = classNames('btn', (_a = {}, _a["btn-" + btnType] = btnType, _a["btn-" + size] = size, _a['disabled'] = (btnType === 'link' && disabled), _a)); if (btnType === 'link' && href) { return (React.createElement("a", { className: classes, href: href }, children)); } else { return (React.createElement("button", { className: classes, disabled: disabled }, children)); } ; }; Button.defaultProps = { disabled: false, btnType: "default", children: "这人太懒了." }; export default Button; // export default null;