12345678910111213141516171819202122232425 |
- import React from 'react';
- import { Link } from 'react-router-dom';
- import './index.less';
- function Tabs(props) {
- const { tabs = [], type = 'line', width, space, border, active } = props;
- return (
- <div className={`tabs ${type} ${border ? 'border' : ''}`}>
- {tabs.map(item => {
- return (
- <Link to={item.path}>
- <div
- style={{ width: width || '', marginLeft: space || '', marginRight: space || '' }}
- className={`tab ${active === item.key ? 'active' : ''}`}
- >
- {item.name}
- </div>
- </Link>
- );
- })}
- </div>
- );
- }
- Tabs.propTypes = {};
- export default Tabs;
|