1.0.0 • Published 3 years ago
wxy-tools-b v1.0.0
安装
npm i wxy-tools-a
导入
const wxy = require("./wxy-tools-a")
格式化日期
// 格式化时间的功能
const dtStr = itheima.dateFormat(new Date())
console.log(dtStr);
测试
//标签转化为字符串
const htmlStr = `<h1 title='abc'>这是h1标签<span>123 </span></h1>`
const str = itheima.htmlEscape(htmlStr)
console.log(str);
测试 还原
// 字符串还原为标签
const str1 = itheima.htmlUnEscape(str)
console.log(str1);
1.0.0
3 years ago