1.4.2 • Published 2 months ago

@bud-fe/react-pc-ui v1.4.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

@bud-fe/react-pc-ui

NPM version doc github codecov

基于 Ant Design 的百威前端 React 组件库


📦 安装

先确保项目已安装 antd@^4.0.0@ant-design/pro-form@^1.52.5ahooks@^3.1.3

然后执行

$ pnpm add @bud-fe/react-pc-ui
# or
$ npm i --save @bud-fe/react-pc-ui
# or
$ yarn add @bud-fe/react-pc-ui

🔨 使用

1. 引入组件

直接引入组件即可,组件库会自动为你加载 css 样式文件(since v0.3.1):

import { BfFormTable } from '@bud-fe/react-pc-ui';

2. 定制 antd 主题

由于PC 后台页面设计规范中的部分组件样式我们无法仅仅通过修改 antd 的 less 变量来实现,所以还需要在项目入口处引入对应 css 来覆盖 antd 组件默认的样式。

目前提供了两种主题:百威红、品牌黄(since v0.6.0

  1. 引入修改 antd less 变量的对象。比如在 ice 项目中的 build.config.js
// 百威红
import themeConfig from '@bud-fe/react-pc-ui/es/styles/antd-theme-red';
// or
// 品牌黄
import themeConfig from '@bud-fe/react-pc-ui/es/styles/antd-theme-yellow';

export default {
  // ...
  plugins: [
    // ...
    [
      'build-plugin-antd',
      {
        // ...
        themeConfig: {
          ...themeConfig,
          // TODO: 其他需要修改的 antd less 变量。详见 https://4x.ant.design/docs/react/customize-theme-cn
        },
      },
    ],
  ],
};
  1. 引入覆盖 antd 组件默认样式的 css。在全局样式文件中,比如 ice 项目中的 global.less
/* 百威红 */
@import '~@bud-fe/react-pc-ui/es/styles/antd-theme-red.css';
/* or */
/* 品牌黄 */
@import '~@bud-fe/react-pc-ui/es/styles/antd-theme-yellow.css';

按需加载

组件库支持基于 Tree Shaking 的按需加载,大部分的构建工具(例如 webpack 4+ 和 rollup)都支持 Tree Shaking,所以绝大多数情况下你无需做额外的配置即可拥有较小的包体积。

手动的按需加载

PS: 对于目前百威基于飞冰的 console 端工程来说,不用考虑以下情况

如果你的环境不支持 Tree Shaking,那么你可以手动引入部分组件:

import BfFormTable from '@bud-fe/react-pc-ui/es/components/form-table';
1.4.2

2 months ago

1.4.1

2 months ago

1.4.1-alpha.0

2 months ago

1.4.0-alpha.0

3 months ago

1.4.0-alpha.1

3 months ago

1.4.0-alpha.2

3 months ago

1.4.0-alpha.3

3 months ago

1.4.0

2 months ago

1.4.0-alpha.8

3 months ago

1.4.0-alpha.9

2 months ago

1.4.0-alpha.4

3 months ago

1.4.0-alpha.5

3 months ago

1.4.0-alpha.6

3 months ago

1.4.0-alpha.7

3 months ago

1.2.12

7 months ago

1.2.13

7 months ago

1.3.0-alpha.0

6 months ago

1.2.16

6 months ago

1.2.17

6 months ago

1.2.14

7 months ago

1.2.15

6 months ago

1.3.1-alpha.0

5 months ago

1.3.5

4 months ago

1.3.4

4 months ago

1.3.3

4 months ago

1.3.2

5 months ago

1.3.1

5 months ago

1.3.0

6 months ago

1.2.11

8 months ago

1.2.10

10 months ago

1.2.9

10 months ago

1.2.8

10 months ago

1.2.7

11 months ago

1.2.6

11 months ago

1.2.5

11 months ago

1.2.4

11 months ago

1.2.3

12 months ago

1.2.3-alpha.3

12 months ago

1.2.3-alpha.4

12 months ago

1.2.3-alpha.5

12 months ago

1.2.3-alpha.0

12 months ago

1.2.3-alpha.1

12 months ago

1.2.3-alpha.2

12 months ago

1.2.2

12 months ago

1.2.2-alpha.0

12 months ago

1.2.1

1 year ago

1.2.0

1 year ago

1.2.0-alpha.4

1 year ago

1.2.0-alpha.5

1 year ago

1.2.0-alpha.2

1 year ago

1.2.0-alpha.3

1 year ago

1.2.0-alpha.0

1 year ago

1.2.0-alpha.1

1 year ago

0.9.5-alpha.1

1 year ago

0.9.5-alpha.2

1 year ago

1.0.0-alpha.0

1 year ago

0.9.5-alpha.0

1 year ago

0.9.5-alpha.5

1 year ago

0.9.5-alpha.3

1 year ago

0.9.5-alpha.4

1 year ago

1.1.5-alpha.0

1 year ago

1.1.5-alpha.1

1 year ago

1.1.5-alpha.2

1 year ago

1.1.5-alpha.3

1 year ago

1.1.5-alpha.4

1 year ago

1.1.5-alpha.5

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

0.9.7

1 year ago

0.9.6

1 year ago

0.9.5

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.6-alpha.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

0.9.4

1 year ago

0.9.3

1 year ago

0.9.3-alpha.1

1 year ago

0.9.4-alpha.0

1 year ago

0.9.3-alpha.0

2 years ago

0.9.0

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.9.0-alpha.8

2 years ago

0.9.0-alpha.0

2 years ago

0.9.0-alpha.1

2 years ago

0.9.0-alpha.2

2 years ago

0.9.0-alpha.3

2 years ago

0.9.0-alpha.4

2 years ago

0.9.0-alpha.5

2 years ago

0.9.0-alpha.6

2 years ago

0.9.0-alpha.7

2 years ago

0.8.5

2 years ago

0.8.4

2 years ago

0.8.7

2 years ago

0.8.6

2 years ago

0.8.3-alpha.0

2 years ago

0.7.6

2 years ago

0.7.5

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.8.3

2 years ago

0.8.2

2 years ago

0.6.7

2 years ago

0.6.6

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.7.4

2 years ago

0.7.3

2 years ago

0.7.0

2 years ago

0.6.0-alpha.1

2 years ago

0.6.0-alpha.2

2 years ago

0.6.0-alpha.0

2 years ago

0.6.0-alpha.3

2 years ago

0.6.0-alpha.4

2 years ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.5

2 years ago

0.6.4

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.6

2 years ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.5

2 years ago

0.5.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago

0.4.3

2 years ago

0.1.20

3 years ago

0.1.21

3 years ago

0.1.22

3 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

3 years ago

0.3.5

2 years ago

0.4.1

2 years ago

0.3.2

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.3.4

2 years ago

0.4.2

2 years ago

0.3.3

2 years ago

0.1.18

3 years ago

0.1.19

3 years ago

0.1.10

3 years ago

0.1.11

3 years ago

0.1.12

3 years ago

0.1.13

3 years ago

0.1.14

3 years ago

0.1.15

3 years ago

0.1.16

3 years ago

0.1.17

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.9

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.1.0-alpha.2

3 years ago

0.1.0-alpha.1

3 years ago

0.1.0-alpha.0

3 years ago