1.1.0 • Published 3 years ago
lily4434-tools v1.1.0
安装
npm install my-tools
导入
const mytools = require('my-tools')
格式化时间
//调用dateFormat对事件进行格式化
const str = mytools.dateFormat(new Date())
console.log(str)
转义HTML中特殊字符
//待转换的HTML字符串
const str ='<h1 title="hello">这里是我的家乡</h1>'
const re = mytools.htmlEscape(str);
//<h1 title="hello">这里是我的家乡</h1>
console.log(re)
还原HTML
1.1.0
3 years ago