dtd
Version:
根据数梦工场视觉规范打造的组件库,感谢react-components和ant design
1 lines • 1.58 kB
JavaScript
import _extends from"babel-runtime/helpers/extends";import _defineProperty from"babel-runtime/helpers/defineProperty";import _typeof from"babel-runtime/helpers/typeof";import _classCallCheck from"babel-runtime/helpers/classCallCheck";import _createClass from"babel-runtime/helpers/createClass";import _possibleConstructorReturn from"babel-runtime/helpers/possibleConstructorReturn";import _inherits from"babel-runtime/helpers/inherits";import*as React from"react";import ScrollableInkTabBar from"rc-tabs/es/ScrollableInkTabBar";import classNames from"classnames";var TabBar=function(e){function r(){return _classCallCheck(this,r),_possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return _inherits(r,e),_createClass(r,[{key:"render",value:function(){var e,r=this.props,t=r.tabBarStyle,a=r.animated,n=r.renderTabBar,s=r.tabBarExtraContent,o=r.tabPosition,l=r.prefixCls,i=r.className,c=r.size,p=r.type,m="object"===(void 0===a?"undefined":_typeof(a))?a.inkBar:a,b=React.createElement("span",{className:l+"-tab-prev-icon"}),f=React.createElement("span",{className:l+"-tab-next-icon"}),u=classNames(l+"-"+o+"-bar",(_defineProperty(e={},l+"-"+c+"-bar",!!c),_defineProperty(e,l+"-card-bar",p&&p.indexOf("card")>=0),e),i),d=_extends({},this.props,{children:null,inkBarAnimated:m,extraContent:s,style:t,prevIcon:b,nextIcon:f,className:u}),h=void 0;return h=n?n(d,ScrollableInkTabBar):React.createElement(ScrollableInkTabBar,d),React.cloneElement(h)}}]),r}(React.Component);export default TabBar;TabBar.defaultProps={animated:!0,type:"line"};