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

pzy-react-iconfont

v0.0.1

Published

在线方式使用iconfont图标

Downloads

1

Readme

pzy-react-iconfont

作用

在线方式使用iconfont图标

源代码仓库: Gitee

npm资源: npm

在线示例: 在线示例

原理

  • 接收scriptUrl参数(为iconfont的symbol的js地址),自动创建一个script标签
  • 根据传入的type参数(为iconfont的图标标识),自动创建一个svg标签

IconFont组件属性说明

| 属性名 | 类型 | 说明 | | ------ | ------ | ------ | | type | string | iconfont图标标识(必须) | | className | string | 应用到该图标上的class(可选) | | style | CSSProperties | 独立的style样式(可选) |

使用示例

const IconFont = createFromIconfontCN('//at.alicdn.com/t/font_8d5l8fzk5b87iudi.js');
<IconFont type="icon-tuichu" style={{fill:'red'}}/>

storybook编写注意事项

文件名必须与导出的自定义组件同名, 否则无法生成属性信息.

即: 组件文件名为:Button.tsx, 那么该文件内部也必须export default Button, 如果不这样无法生成属性列表

编写storybook时, 必须引用组件的源文件, 而不能使用引用的引用, 否则无法生成属性信息

即: 如果有组件:src/lib/button/Button.tsx, 在src/index.tsx导出了该组件, 如果编写storybook时, 引入的是src/index.tsx那么将无法生成属性列表, 必须引用src/lib/button/Button.tsx才行

目录说明

src                     # 源代码目录
|-index.tsx             # 只有在该文件导出的组件,才能被用户引用
|-index.config.ts       # ts配置文件
stories                 # storybook目录
example                 # 自行调用实验目录(基于parcel)
main.ts                 # storybook配置文件
manager.js              # storybook配置文件
YourTheme.js            # storybook配置文件
tsdx.config.js          # tsdx配置文件
tsconfig.json           # ts配置文件

命令说明

运行tsdx的监听

npm start # or yarn start

执行tsdx打包

npm build # or yarn build

运行storybook

npm storybook # or yarn storybook

storybook打包

npm build-storybook # or yarn build-storybook

将组件上传npm

yarn build
npm login # npm登录
npm pub # 组件发布