npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ant_design_pro_tabs

v0.1.9

Published

ant design pro 多标签组件(Multi-tab for ant design pro)

Readme

Ant Design Pro Tabs

大家想要的,带有tab标签的ant design pro 又叕来啦!!!

  • 代码已经重写,使用hooks进行开发,精力有限,只出了js版本,需要ts的同学把类型改成any就好了(手动捂脸)

  • 基于最新版ant-design-pro 4.0 (仍然保留2.3.0包版本组件,TabPages/old.js就是了)

  • 原汁原味,只添加了tab,其他均无修改

  • 保留完整权限,输入错误地址仍然可以显示403

  • 模块化代码,最低引入一个文件即可完成tab的添加

  • 利用sessionStorage,刷新页面仍显可以显示之前未关闭的标签,重新打开浏览器只会显示路由所在的标签

  • 刷新页面会提示信息无法被保存(可在window.onbeforeunload中修改,删除此行就可以屏蔽该功能)

  • 样式方面参考了:https://github.com/kuhami/react-ant

  • 类库使用:good-storage

  • TODO:1. 隐藏标签实现类vue的keep-alive

BUG:

  • 1.通过路由传参会找不到页面,从而报错

  • 2.由于pro4.0没有menuData传进来,渲染全靠props.routes渲染,所以国际化可能会有点问题,导致路由路径必须和国际化一直,比如路径是a/b/c,那么国际化必须写成menu:{a:{b:{c:"xxxxx"}}},否则会tab可能会显示不正常

  • 3.输入错误的路由时逻辑还有点小问题,待修复

  • 4.页签限制功能(maxTab),计算有时不准,待修复

如有其他问题请反馈,谢谢

注意: 由于框架原因,所有路由都是先走/然后跳转,所以每次tab也都会有一个/,显示为menu.,目前的方法是把这个标签display:none了

pro 4.0 使用方法:

  1. npm i ant_design_pro_tabs(或者复制src/components/TabPages文件夹到自己的项目当中)
  2. import TabPages from 'ant_design_pro_tabs';
  <Authorized authority={authorized.authority} noMatch={noMatch}>
    <TabPages {...props} maxTab="5" preventReload remberRefresh animated homePage="/dashboard/analysis" errorPage="/exception/404" /> 
  </Authorized>
    // 参数:
    // 1. maxTab="5"    标签开多了可能导致浏览器崩溃,设置一个最大数量,超出会提示
    // 2. remberRefresh 刷新页面也能记住之前打开的标签
    // 3. preventReload 刷新页面会提示
    // 4. homePage      主页url
    // 5. errorPage     错误页url
    // 6. animated      是否使用动画切换 Tabs

4.pro 2.0版本(old.js文件)

 <Content>
   {children} //注释此行,改为tab组件
   <TabPages {...this.props} homePageKey='/dashboard/home' errorPage={<NoAuth />} />
</Content>				// homePageKey就是项目首页的url地址
  1. 多标签的信息是存储在sessionStorage的AntTabs中,建议退出登录时清理一下,避免造成bug
  2. 有问题欢迎多交流,github不常在线,着急的话请发邮件或者加我QQ(同邮箱)