# lofter-components

> lofter通用业务组件

Latest version **1.0.2** (published 2022-04-15) · ISC license · 0 weekly downloads

## Install

```sh
npm install lofter-components
pnpm add lofter-components
yarn add lofter-components
bun add lofter-components
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-04-15 |
| First published | 2022-02-25 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 63.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | yousy, guoyeeg, azgaga, liushichuan, yaochen, shenyuan, aflyermin, ignous, jeekdong |

## Links

- npm: https://www.npmjs.com/package/lofter-components
- npm.io page: https://npm.io/package/lofter-components

## Dependencies (2)

- [lofter-utils](https://npm.io/package/lofter-utils.md) ^2.0.8
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.17.2

## Recent versions

- 1.0.2 (latest) — 2022-04-15
- 1.0.1-alpha.0 (alpha) — 2022-02-25
- 1.0.1 — 2022-02-25
- 1.0.0 — 2022-02-25

## README

# lofter-components

## 开发前置工作

- image-upload
- video-upload

以上接口依赖微前端node转发，调试的时候需要配置微前端测试环境域名

```
127.0.0.1 tlofter.hz.netease.com
```

## 图片上传

```

declare type BeforeUploadValueType = void | boolean | string | Blob | File;
interface Props {
  /**
   * 额外描述
   */
  hint?: string;
  /**
   * 图片url地址
   */
  value?: string;
  /**
   * 上传更改回调
   */
  beforeUpload?: (file: {
     file: RcFile,
     width: number,
     height: number
   }, FileList: RcFile[]) => BeforeUploadValueType | Promise<BeforeUploadValueType>;
  /**
   * 接收图片的类型，默认image/*
   */
  accept?: string;
  /**
   * 上传接口前缀，用于微前端，默认/api/imgUpload
   */
  prefix?: boolean;
}
```

## 视频上传

```
interface Props {
  /**
   * 额外描述
   */
  hint?: string;
   /**
   * 视频url地址
   */
  value?: string;
   /**
   * 上传更改回调
   */
  onChange?: (value: string) => void;
   /**
   * 接收图片的类型，默认image/*
   */
  accept?: string;
   /**
   * 上传接口前缀，用于微前端，默认/api/imgUpload
   */
  prefix?: boolean;
  /**
   * 上传前的校验函数
   */
  beforeUpload?: (file: File) => void;
}
```

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