da_utils
v0.0.8
Published
``` npm i da_utils@latest --save ```
Downloads
29
Readme
我的前端通用工具
安装
npm i da_utils@latest --save
用法
import DaUtils from 'da_utils';
console.log(DaUtils.DateUtils.dateFormat(new Date()));
说明
- DaUtils.Utils 常用工具
- DaUtils.DateUtils 日期工具
- DaUtils.ColorUtils 颜色工具
- DaUtils.Event 事件
- DaUtils.WebUtils 常用web工具
- DaUtils.Platform 浏览器信息
- DaUtils.ImageUtils 图片处理工具
- DaUtils.FileUtils 文件处理工具
- DaUtils.HttpClient 网络请求
- DaUtils.form 响应式表单
开发
npm run build // 打包
DaUtils.HttpClient 网络请求
const http = new DaUtils.HttpClient({
base: 'https://e.aidingyi.cn/',
header: { 'Content-Type': 'application/json' },
init: (httpClient) => {
httpClient.header = { ...httpClient.header, ...{ 'Api-Authorize-Token': localStorage.getItem('token') ?? '' } }
}
});
const res: any = await http.request({
title: `请求列表`,
uri: `module_listing`,
method: 'POST',
data: { module, ...param },
debounce: 0,
});
DaUtils.form 响应式表单
- FormControl
- FormGroup
- FormArray
- FormBuilder 便捷方法来生成表单控件
- FormUtils 表单工具
- Validators 验证器