# da_utils_react_antd **Repository Path**: lilarabe/da_utils_react_antd ## Basic Information - **Project Name**: da_utils_react_antd - **Description**: 我的 react antd 前端工具 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-10-30 - **Last Updated**: 2024-10-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 我的前端通用工具 依赖 react sass, antd, antd-mobile, @ant-design/icons, antd-mobile-icons ## 安装 ``` 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 响应式表单 * DaUtils.components antd 组件 ## 开发 ``` npm run dev // 开发 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 验证器 #### DaUtils.components: antd和 antd-mobile 组件 * ScrollPage 滚动页面,一般手机端使用 * JSErrorPage js 报错页 * AntdTheme antd 自定义主题 * ScreenModal 弹框 * ImagePreview 图片预览 * Upload 上传 * CdnImage cdn 图片 * form 表单类组件