UNPKG

mr-component

Version:
51 lines 2.05 kB
import _extends from "@babel/runtime/helpers/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; var _excluded = ["text", "type", "size", "color", "disabled", "loading", "round", "square", "block", "icon", "iconPosition", "onClick", "style", "className"]; import * as React from 'react'; import { forwardRef } from 'react'; import { Button } from 'react-vant'; var VantButton = function VantButton(props, ref) { var _props$text = props.text, text = _props$text === void 0 ? '按钮' : _props$text, _props$type = props.type, type = _props$type === void 0 ? 'default' : _props$type, _props$size = props.size, size = _props$size === void 0 ? 'normal' : _props$size, color = props.color, _props$disabled = props.disabled, disabled = _props$disabled === void 0 ? false : _props$disabled, _props$loading = props.loading, loading = _props$loading === void 0 ? false : _props$loading, _props$round = props.round, round = _props$round === void 0 ? false : _props$round, _props$square = props.square, square = _props$square === void 0 ? false : _props$square, _props$block = props.block, block = _props$block === void 0 ? false : _props$block, icon = props.icon, _props$iconPosition = props.iconPosition, iconPosition = _props$iconPosition === void 0 ? 'left' : _props$iconPosition, onClick = props.onClick, style = props.style, className = props.className, others = _objectWithoutPropertiesLoose(props, _excluded); return /*#__PURE__*/React.createElement(Button, _extends({ ref: ref, type: type, size: size, color: color, disabled: disabled, loading: loading, round: round, square: square, block: block, icon: icon, iconPosition: iconPosition, onClick: onClick, style: style, className: className }, others), text); }; var RefVantButton = /*#__PURE__*/forwardRef(VantButton); RefVantButton.displayName = 'VantButton'; export default RefVantButton;