wxy-tools-b

提供了格式化事件,HTMLEscape 功能

Usage no npm install needed!

<script type="module">
  import wxyToolsB from 'https://cdn.skypack.dev/wxy-tools-b';
</script>

README

安装

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&nbsp;</span></h1>` 
const str = itheima.htmlEscape(htmlStr)
console.log(str);

测试 还原

// 字符串还原为标签
const str1 = itheima.htmlUnEscape(str)
console.log(str1);