-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
陈书航
committed
Jan 19, 2022
1 parent
d19177e
commit 4b769de
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters