Package Exports
- itheima-tools-djl
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (itheima-tools-djl) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
安装
npm install itheima-tools-djl导入
const itheima = ruquire("itheima-tools-djl")格式化时间
const dtstr = itheima.dateFormat(new Date());
console.log(dtstr); // 结果2021-09-17 14:03:35转义HTML中的特殊字符
const htmlStr = '<h1 title="abc">这是h1标签<span>123 </span></h1>';
// 调用htmlEsccpae()转换
const str = itheima.htmlEsccpae(htmlStr);
console.log(str); //<h1 title="abc">这是h1标签<span>123&nbsp;</span></h1>
// 调用htmlEsccpae()还原
console.log(itheima.htmlUnEsccpae(str)); //<h1 title="abc">这是h1标签<span>123 </span></h1>