0.1.46 • Published 3 years ago
@pgyer/icons v0.1.46
icons
概述
icons 提供自定义的图标集。
安装和配置
- 使用
yarn或npm安装组件包
yarn add git+ssh:git@codefever.pgyer.com:PGYER/icons.git@latest
yarn upgrade @pgyer/icons- 配置 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 /> 都能满足使用要求。
- 引入
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { iconName } from '@pgyer/icons'或
import { PIcon, iconName } from '@pgyer/icons'- 调用
与 FontAwesomeIcon 组件使用方法相同
<FontAwesomeIcon icon={iconName} />
<PIcon icon={iconName} />属性列表
与 FontAwesomeIcon 组件属性列表相同。
0.1.41
3 years ago
0.1.42
3 years ago
0.1.43
3 years ago
0.1.44
3 years ago
0.1.45
3 years ago
0.1.46
3 years ago
0.1.40
3 years ago
0.1.39
3 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
4 years ago
0.0.19
4 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