使用 Tabs实现的,标题高亮组件
TabTitle.js
import React, {memo} from 'react'
import {string} from 'prop-types'
import { Tabs } from 'antd'
const { TabPane } = Tabs
TabTitle.propTypes = {
title: string.isRequired
}
function TabTitle({ title, children }) {
return (
<Tabs tabBarExtraContent={ children }>
<TabPane tab={title} key="1" />
</Tabs>
)
}
export default memo(TabTitle)
参数说明
- title,标题,必填项
- children,右侧的额外展示内容,非必填
使用组件
import TabTitle from './TabTitle';
<TabTitle title="基金排行榜" />