Delete tabBar.jsx

pull/309/head
tangjinzhou 2018-12-12 21:32:56 +08:00 committed by GitHub
parent 6f71252753
commit 592d2b3c29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 58 deletions

View File

@ -1,58 +0,0 @@
import Icon from '../icon'
import ScrollableInkTabBar from '../vc-tabs/src/ScrollableInkTabBar'
import { cloneElement } from '../_util/vnode'
const TabBar = {
functional: true,
render (h, context) {
const {
tabBarStyle,
animated = true,
renderTabBar,
tabBarExtraContent,
tabPosition,
prefixCls,
} = context.props
const inkBarAnimated = typeof animated === 'object' ? animated.inkBar : animated
const isVertical = tabPosition === 'left' || tabPosition === 'right'
const prevIconType = isVertical ? 'up' : 'left'
const nextIconType = isVertical ? 'down' : 'right'
const prevIcon = (
<span class={`${prefixCls}-tab-prev-icon`}>
<Icon type={prevIconType} class={`${prefixCls}-tab-prev-icon-target`} />
</span>
)
const nextIcon = (
<span class={`${prefixCls}-tab-next-icon`}>
<Icon type={nextIconType} class={`${prefixCls}-tab-next-icon-target`} />
</span>
)
const renderProps = {
props: {
...context.props,
inkBarAnimated,
extraContent: tabBarExtraContent,
prevIcon,
nextIcon,
},
style: tabBarStyle,
on: {
...context.listeners,
},
}
let RenderTabBar
if (renderTabBar) {
RenderTabBar = renderTabBar(renderProps, ScrollableInkTabBar)
} else {
RenderTabBar = <ScrollableInkTabBar {...renderProps} />
}
return cloneElement(RenderTabBar, renderProps)
},
}
export default TabBar