1.0.0 • Published 2 years ago
itheima-tools-lcb v1.0.0
安装方式
npm install itheima-tools-lcb
导入
cosnt itheima = require('iteheima-tools')
格式化时间
//调用dateFormat 对时间进行格式化
console.log(itheima.dateFormat(new Date))
转义html中的特殊字符
//定义转换的字符
const htmlStr = '<h1 title="abc">标签1212 </h1>'
//转义后
const zhuan = itheima.htmlEscape(htmlStr)
//还原转义后的html字符
console.log(itheima.htmlUnEscape(zhuan))
协议
ISC
1.0.0
2 years ago