1.0.0 • Published 2 years ago
itheima-lsymytools v1.0.0
安装
npm install iteheima-lsymytools
导入
const itheima = require('itheima-lsymytools')
格式化事件
//调用dateFormat对事件进行格式化
const dtStr = iteheima.dataFormat(new Date())
//结果 2022-08-14 18:37:23
console.log(dtStr)
转义HTML中的特殊字符
const htmlStr = '<h1 title="abc">这是h1标签<span>123 </span></h1>h1>'
const str = iteheima.htmlEscape(htmlStr)
开源协议
ISC
1.0.0
2 years ago