1.0.1 • Published 5 years ago

zfzn-components v1.0.1

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

zfzn-components

介绍

前端基于 React 的业务组件库,用于不同项目之间,相同组件的模块化利用,提高生产效率

软件架构

  1. 前端技术采用 React
  2. 基础组件采用 ant design 组件库

安装教程

  1. npm i zfzn-components 或者 yarn add zfzn-components

使用说明

  1. 默认启用按需引入方式,组件引用方式与 ant 组件库相同。
import { Alert } from 'zfzn-components';
import 'zfzn-components/lib/alert/style';
  1. 如果配置 babel-plugin-import 自动引入样式文件,也可省去手动引入样式。 umi 项目配置如下:
// .umirc.js文件中加入 extraBabelPlugins 属性
export default {
  extraBabelPlugins: [
    [
      'import',
      {
        libraryName: 'zfzn-components',
        libraryDirectory: 'lib',
        style: 'css',
      },
    ],
  ],
};

配置完成后,重新启动项目,仅引入组件即可

import { Alert } from 'zfzn-components';