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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@hzab/sider

v0.1.0

Published

侧边栏

Downloads

69

Readme

@hzab/sider

侧边栏组件

组件

示例

import Demo from "@hzab/sider";

<Demo
  menus={[
    { key: "/", label: "首页", title: "首页" },
    {
      key: "/user-server",
      label: "用户服务",
      icon: "UserOutlined",
      children: [
        {
          key: "/user-server/user-list",
          label: "用户管理",
        },
        {
          key: "/user-server/role-list",
          label: "角色管理",
        },
        {
          key: "/user-server/org-list",
          label: "组织管理",
        },
      ],
    },
    {
      key: "/sys-server",
      label: "系统服务",
      icon: "UserOutlined",
      children: [
        {
          key: "/sys-server/config-list",
          label: "配置管理",
        },
        {
          key: "/sys-server/color-list",
          label: "颜色管理",
        },
        {
          key: "/sys-server/size-list",
          label: "尺寸管理",
        },
      ],
    },
  ]}
/>;

API

InfoPanel Attributes

| 参数 | 类型 | 必填 | 默认值 | 说明 | | -------------- | ------- | ---- | ------ | ----------------------------------------------- | --- | | menus | Array | 是 | - | 侧边栏数据 | | | collapsible | boolean | 否 | - | 是否可以收起 | | | collapsedWidth | number | 否 | - | 收缩宽度,设置为 0 会出现特殊 trigger(定位块) | |

MenuItem

| 参数 | 类型 | 必填 | 默认值 | 说明 | | -------- | ------ | ---- | ------ | ----------------------------- | --- | | key | string | 是 | - | 跳转地址 | | | label | string | 是 | - | 文案 | | | icon | string | 是 | - | icon,可以是 antd icon 字符串 | | | children | Array | 是 | - | 子集 | |

组件开发流程

  • 在 config/webpack.config.js 中按需修改 library 配置的文件名
  • 在 config/webpack.config.js 中按需修改 alias 配置的包名,便于本地调试
  • 在 src/typings.d.ts 中按需修改 declare module 配置的包名,解决 ts 报错问题
  • npm run dev

文件目录

  • example 本地开发测试代码
  • src 组件源码
  • lib 组件打包编译后的代码

命令

  • 本地运行:npm run dev
  • 打包编译:npm run build

发布

  • 注意:示例代码生效,但发布之后未生效。确认是否执行了编译!!!

  • 编译组件:npm run build

  • 命令:npm publish --access public

  • 发布目录:

    • lib
    • src

配置

配置文件

  • 本地配置文件:config/config.js

webpack 配置文件

  • config/webpack.config.js