# easy-do-it

> 基于 antd@4 版本开发

Latest version **1.0.0** (published 2022-10-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install easy-do-it
pnpm add easy-do-it
yarn add easy-do-it
bun add easy-do-it
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-10-26 |
| First published | 2022-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 19 |
| Unpacked size | 1.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | carrygxl |

## Links

- npm: https://www.npmjs.com/package/easy-do-it
- npm.io page: https://npm.io/package/easy-do-it

## Dependencies (19)

- [umi](https://npm.io/package/umi.md) ^3.5.20
- [antd](https://npm.io/package/antd.md) ^4.22.6
- [react](https://npm.io/package/react.md) ^16.14.0
- [ahooks](https://npm.io/package/ahooks.md) ^3.4.0
- [big.js](https://npm.io/package/big.js.md) ^6.2.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [moment](https://npm.io/package/moment.md) ^2.29.1
- [react-dom](https://npm.io/package/react-dom.md) ^16.13.1
- [react-svg](https://npm.io/package/react-svg.md) ^15.1.7
- [classnames](https://npm.io/package/classnames.md) ^2.3.1
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.18.0
- [react-draggable](https://npm.io/package/react-draggable.md) ^4.4.4
- [react-json-view](https://npm.io/package/react-json-view.md) ^1.21.3
- [react-resizable](https://npm.io/package/react-resizable.md) ^3.0.4
- [@ant-design/icons](https://npm.io/package/@ant-design/icons.md) ^4.2.2
- [react-sortable-hoc](https://npm.io/package/react-sortable-hoc.md) ^1.11.0
- [react-drag-listview](https://npm.io/package/react-drag-listview.md) ^0.1.8
- [@pansy/react-watermark](https://npm.io/package/@pansy/react-watermark.md) 3.1.13
- [@zat-design-pro-component/utils](https://npm.io/package/@zat-design-pro-component/utils.md) ^1.0.14

## Recent versions

- 1.0.0 (latest) — 2022-10-26

## README

## 快速上手

基于 antd@4 版本开发

### 安装

npm 或 yarn 安装

```
# npm
$ npm install easy-do-it --save

# yarn
$ yarn add easy-do-it
```

### 按需加载

采用 babel-plugin-import 方式

```
[
  'babel-plugin-import',
      {
        libraryName: 'easy-do-it',
        camel2DashComponentName:false,
        libraryDirectory: 'es',
        style: false,
      },
],
```

以下为在 umi 框架下配置按需加载，同时也配置 antd 的按需加载情况下,再配置一个 babel-plugin-import 时需要配置一个别名，可参考下面

```
 extraBabelPlugins: [
    [
      'babel-plugin-import',
      {
        libraryName: 'antd',
        libraryDirectory: 'es',
        style: true,
      },
    ],
    [
      'babel-plugin-import',
      {
        libraryName: 'easy-do-it',
        camel2DashComponentName:false,
        libraryDirectory: 'es',
        style: false,
      },
      'easy-do-it'
    ],
  ]
```

### 使用

1. 可通过 npm 包进行引用

```
import React from 'react';
import { render } from 'react-dom';
import { ProForm } from 'easy-do-it';

const App = () => {
  return (
    <ProForm
      max={5}
      columns={[
        {
          type: 'Input',
          colProps: {
            span: 8,
          },
          formItemProps: {
            label: '姓名',
            name: 'name',
            rules: [{ required: true, message: '请输入姓名！' }],
          },
          formItemChildProps: {
            placeholder: '请输入',
          },
        }]}
    />
  );
};

render(<App />, document.getElementById('root'));
```

2. 如组件无法满足业务场景使用，但大部分可复用可联系我们进行补充调整，也可以单独 copy 进行调整

### 组件库打包发布

1. build:types 生成类型文件
2. build:es 生产 es6 代码文件 module 指向该文件
3. build:lib 生产 es5 代码文件 main 指向该文件
4. release: "yarn build:types & yarn build:es && yarn build:lib && npm publish" 打包 3 个文件进行发布
5. 执行 yarn build 成功
6. 执行 yarn release

---
_Source: https://npm.io/package/easy-do-it · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
