@jdcfe/yep-react
Version:
一套移动端的React组件库
57 lines (47 loc) • 2.42 kB
JavaScript
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _createClass from "@babel/runtime/helpers/createClass";
import _inherits from "@babel/runtime/helpers/inherits";
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
import * as React from 'react';
import classNames from 'classnames';
import Tab from './Tab';
var TabBar = /*#__PURE__*/function (_React$Component) {
_inherits(TabBar, _React$Component);
var _super = _createSuper(TabBar);
function TabBar() {
_classCallCheck(this, TabBar);
return _super.apply(this, arguments);
}
_createClass(TabBar, [{
key: "render",
value: function render() {
var _this$props = this.props,
prefixCls = _this$props.prefixCls,
className = _this$props.className,
style = _this$props.style,
barTintColor = _this$props.barTintColor,
hidden = _this$props.hidden,
children = _this$props.children;
var cls = classNames(prefixCls, className, _defineProperty({}, "".concat(prefixCls, "-hidden"), hidden));
var tabBarStyle = Object.assign(Object.assign({}, style), {
backgroundColor: barTintColor
});
return /*#__PURE__*/React.createElement("div", {
className: cls,
style: tabBarStyle
}, children);
}
}]);
return TabBar;
}(React.Component);
TabBar.defaultProps = {
prefixCls: 'Yep-tab-bar',
barTintColor: 'white',
hidden: false
};
TabBar.Tab = Tab;
export default TabBar;