# ant_pro_tabs
**Repository Path**: lornes/ant_pro_tabs
## Basic Information
- **Project Name**: ant_pro_tabs
- **Description**: 基于Ant design Pro 4 实现多标签页 (multi tabs、url直接访问、切换、关闭等)
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 1
- **Created**: 2024-10-15
- **Last Updated**: 2024-10-15
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
#### 基于 Ant Design Pro 4 实现多标签页面,包括:路由联动,列表,多详情页共存,自动新增、关闭标签等功能:
[demo地址](http://pc.loveeveryday.cn/ant-pro-tabs)
#### 关键修改
* BasicLayout.tsx 使用layout重写了原文件,使用时不依赖config中的路由配置,可酌情使用;
* BasicLayoutBak.tsx 原布局基础上实现多标签,依赖config中路由配置;
#### 实现思路
* 传统单页面路由切换时替换``内组件,在原来的基础上嵌套一层tabs,类似``;
* tab内的标签状态储存到redux全局store中,在layout组件中拦截路由变化,变更store内tab数据;
* 要实现类型打开多个详情页面,则在tab key中加入主键参数,实现一个详情组件同时开多个详情页功能;
#### 使用
```bash
git clone https://github.com/Fengly0503/ant_pro_tabs.git
```
Install `node_modules`:
```bash
npm install
```
or
```bash
yarn
```
#### 启动
```bash
npm start
```
#### 打包
```bash
npm run build
```
#### 参考文档
And Design Pro: [官网](https://pro.ant.design). git 地址:[github](https://github.com/ant-design/ant-design-pro).