1.0.0 • Published 1 year ago

vue-day02 v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

安装

npm install vue-day02

导入

const tools = require('vue-day02')

格式化时间

// 格式化日期
const dt = new Date()
console.log(dateFormata.dateFormat(dt))

转义 HTML 中的特殊字符

// 转义 HTML 特殊字符串
const htmlStr_escape = '<h1 title="mytitle">这是H1标题</h1>'
const result_escape = htmlEscape.htmlEscape(htmlStr_escape)
console.log(result_escape)

还原 HTML 中的特殊字符

// 还原 HTML 特殊字符串
const htmlStr_unescape = '&lt;h1 title=&quot;mytitle&quot;&gt;这是H1标题&lt;/h1&gt;'
const result_unescape = tools.htmlUnEscape(htmlStr_unescape)
console.log(result_unescape)

## 开源协议
ISC
1.0.0

1 year ago