包详细信息

cjl_npm_tools

stark_cjl17ISC1.1.5

提供了关于时间,日期方面的方法,还有像深度拷贝,封装的百度翻译,16进制颜色转换等

cjl, dateFormat, escape, getHexOpacityColor

自述文件

安装

、、、 npm install cjl-tools

导入

、、、js const tools=require('cjl-tools')

格式化时间(获取当前时间)

const time=tools.dateFormat(new Date())

转移html中的特殊字符

、、、例: const html='

给我转一下

' const htmlStr=tools.htmlEscape(html)

带还原的html字符串

const Unhtml=tools.UnhtmlEscape(htmlStr)

灵活排序

const list=list.tools.SotrPare('需要排序的属性名称',true) //true:升序,false:降序

百度翻译 (e:所需要配翻译的文字,lang:语言类型 'zh':中文,'en':英文,目前只有中英互)

js-md5(安装请求加密第三方插件),vue-jsonp (动态创建javascript插件)

let name =await tools.MTtrans(e,lang)

开源协议

ISC