milk-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.1.9 • Public • Published

milk-plugin

基于 typescirpt 的 js 插件组件库

用法

// 1. 安装
npm install milk-plugin --save
// 2. 导入插件
import {Utils} from 'milk-plugin'
// 3. 使用
Utils.formatDate()

API

  1. Utils工具包
方法名 描述 入参
getURLParams 获取当前连接的参数 (name?:string)
formatDate 格式化日期(默认解析当前本地时间) (datetime?: number | Date, format?: string)
getDevice 获取当前设备类型 -
  1. CanvasUtil相关操作

CanvasUtils是个实体类,使用需要实例化new CanvasUtil

方法名 描述 入参
compressImage 图片压缩(默认质量分为0.5) (imgUrl: string, quality?: number)
  1. ValidateUtil相关操作

ValidateUtil是通用的校验方法

方法名 描述 入参
valid 提供统一的校验入口(type值可选) valid(value: string, type: ValidateType)

更多类型 Define

详见类型定义

Readme

Keywords

none

Package Sidebar

Install

npm i milk-plugin

Weekly Downloads

0

Version

0.1.9

License

ISC

Unpacked Size

26.6 kB

Total Files

24

Last publish

Collaborators

  • millzhang