Giter VIP home page Giter VIP logo

ant_pro_tabs's Introduction

基于 Ant Design Pro 4 实现多标签页面,包括:路由联动,列表,多详情页共存,自动新增、关闭标签等功能:

demo地址

关键修改

  • BasicLayout.tsx 使用layout重写了原文件,使用时不依赖config中的路由配置,可酌情使用;
  • BasicLayoutBak.tsx 原布局基础上实现多标签,依赖config中路由配置;

实现思路

  • 传统单页面路由切换时替换<content></content>内组件,在原来的基础上嵌套一层tabs,类似<tab><content></content></tab>
  • tab内的标签状态储存到redux全局store中,在layout组件中拦截路由变化,变更store内tab数据;
  • 要实现类型打开多个详情页面,则在tab key中加入主键参数,实现一个详情组件同时开多个详情页功能;

使用

git clone https://github.com/Fengly0503/ant_pro_tabs.git

Install node_modules:

npm install

or

yarn

启动

npm start

打包

npm run build

参考文档

And Design Pro: 官网. git 地址:github.

ant_pro_tabs's People

Contributors

fengly0503 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.