Skip to content

Commit

Permalink
docs: add public function #218
Browse files Browse the repository at this point in the history
  • Loading branch information
陈书航 committed Jan 19, 2022
1 parent d19177e commit 4b769de
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
File renamed without changes.
31 changes: 31 additions & 0 deletions docs/func.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
title: Func
group:
title: Func
path: /func
nav:
title: API
path: /api
---

# 方法

## 使用方法

```js
import {
dateChange,
getByteLen,
getRandom,
transformFile,
} from '@alitajs/dform';
```

## API

| 参数 | 说明 | 类型 |
| ------------- | --------------------------------------------------------------------------- | --------------------------------------------------------- |
| dateChange | 对日期格式进行转化,保证值在 `Safari` 能正常展示,使用方法请参考 `Date` 组件 | `(date: Date \| string) => new Date(YYYY,MM,DD,HH,mm,ss)` |
| getByteLen | 获取字符串的字节数量 | `(val: string) => number` |
| getRandom | 获取随机值 | `() => string` |
| transformFile | 压缩图片 | `(file:File, pictureQuality: 压缩比例(0~1)) => File` |
5 changes: 5 additions & 0 deletions src/utils/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* 这里为用户可使用的公共方法
* 如需写些内部的工具类
* 请编辑在 `tool.ts` 文件下
*/
import dayjs from 'dayjs';
import { FormInstance } from 'rc-field-form/es/interface';

Expand Down

0 comments on commit 4b769de

Please sign in to comment.