1.0.0 • Published 3 years ago
itheima-hzl v1.0.0
##安装
npm install itheima-tools-hzl
##导入
const itheima = require("itheima-tools");
##格式化时间
//调用dateFormat对时间进行格式化
const c = itheima.dateFormat(new Date());
//结果 2020-04-03 17:02:02
console.log(c);
##转义 HTML 中的特殊字符串
//带转换的HTML字符串
const a = '<h1 title="abc">哈哈哈</h1>';
const str = itheima.htmlEscape(a);
console.log(str);
##还原 HTML 中的特殊字符串
//带还原的HTML字符串
const b = "<h1 title="abc">哈哈哈</h1>";
const bb = itheima.htmlUnEscpae(b);
console.log(bb);
1.0.0
3 years ago