0.1.46 • Published 2 years ago

@pgyer/icons v0.1.46

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

icons

概述

icons 提供自定义的图标集。

安装和配置

  1. 使用 yarnnpm 安装组件包
yarn add git+ssh:git@codefever.pgyer.com:PGYER/icons.git@latest
yarn upgrade @pgyer/icons
  1. 配置 webpack Loader

找到 webpack 配置, 找到 module 配置, 找到 rules 后, 在包含 oneOf 的配置中加入如下代码

// 老版本 create-react-app, 可能是这样的
{
  test: /\.(js|mjs|jsx|ts|tsx)$/,
  include: paths.appNodeModules.concat('/@pgyer/icons'),
  loader: require.resolve('babel-loader'),
...

// 升级新版 create-react-app 以后, 可能是这样的
{
  test: /\.(js|mjs|jsx|ts|tsx)$/,
  include: [
    paths.appSrc,
    paths.appNodeModules.concat('/@pgyer/icons')
  ],
  loader: require.resolve('babel-loader'),
...

l18n

icons 不包含 l18n 设置和内容

a11y

icons 不包含 a11y 设置和内容

使用

注意: 需要配合 <FontAwesomeIcon /><PIcon /> 使用
注意: 在使用 彩色图标 时, 必须配合 <PIcon /> 使用, 其余情况 <FontAwesomeIcon /><PIcon /> 都能满足使用要求。

  1. 引入
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { iconName } from '@pgyer/icons'

import { PIcon, iconName } from '@pgyer/icons'
  1. 调用

FontAwesomeIcon 组件使用方法相同

<FontAwesomeIcon icon={iconName} />
<PIcon icon={iconName} />

属性列表

FontAwesomeIcon 组件属性列表相同。

0.1.41

2 years ago

0.1.42

2 years ago

0.1.43

2 years ago

0.1.44

2 years ago

0.1.45

2 years ago

0.1.46

2 years ago

0.1.40

2 years ago

0.1.39

2 years ago

0.1.26

3 years ago

0.1.23

3 years ago

0.1.17

3 years ago

0.1.9

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.0.17

3 years ago

0.0.19

3 years ago

0.0.14

4 years ago

0.0.15

4 years ago

0.0.16

4 years ago

0.0.13

4 years ago