From 83261f7cffa8240c68b65992c7d8bf31c8938bb7 Mon Sep 17 00:00:00 2001 From: baiy Date: Tue, 26 Oct 2021 17:02:47 +0800 Subject: [PATCH] =?UTF-8?q?html=E7=BC=96=E7=A0=81=20#68?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ package-lock.json | 5 +++++ package.json | 3 ++- src/config.js | 1 + src/tool.router.js | 6 +++++- src/views/tool/html.vue | 30 +++++++++--------------------- 6 files changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 6a9f87b..9d6c528 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ npm run build -adapter=[chrome|edge|utools|firefox|web] |jwt解码|`header`, `payload`|√| |Hex/String转换|`hex to string`, `string to hex`, `十六进制转字符串`, `字符串转十六进制`|√| |文本处理|`大小写转换`, `中英文标点转换`, `简繁转换`, `替换`, `字符统计`, `行去重`, `添加行号`, `行排序`, `过滤行首尾不可见字符`,`过滤空行`|√| +|html编码|`html编码`|√| ## 第三方开源库 @@ -116,5 +117,6 @@ npm run build -adapter=[chrome|edge|utools|firefox|web] - [jian_fan](https://www.npmjs.com/package/jian_fan) - [axios](https://www.npmjs.com/package/axios) - [monaco-editor](https://www.npmjs.com/package/monaco-editor) +- [js-htmlencode](https://www.npmjs.com/package/js-htmlencode) > 当然项目中还使用很多不知道姓名的大神的代码, 在这里就不一一感谢 diff --git a/package-lock.json b/package-lock.json index 3a1fb62..9293887 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6955,6 +6955,11 @@ "resolved": "https://registry.npmjs.org/js-calendar/-/js-calendar-1.2.3.tgz", "integrity": "sha512-dAA1/Zbp4+c5E+ARCVTIuKepXsNLzSYfzvOimiYD4S5eeP9QuplSHLcdhfqFSwyM1o1u6ku6RRRCyaZ0YAjiBw==" }, + "js-htmlencode": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/js-htmlencode/-/js-htmlencode-0.3.0.tgz", + "integrity": "sha1-sc4pPflOlviooIsfM2j5d70lVzE=" + }, "js-levenshtein": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", diff --git a/package.json b/package.json index 2c36269..3c14aeb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "c-tool", - "version": "1.8.0", + "version": "1.8.1", "private": true, "scripts": { "serve": "vue-cli-service serve --port 8081", @@ -25,6 +25,7 @@ "is-url": "^1.2.4", "jian_fan": "^1.0.3", "js-base64": "^2.6.4", + "js-htmlencode": "^0.3.0", "js-yaml": "^3.14.1", "json-to-properties": "^1.1.3", "jsonlint": "^1.6.3", diff --git a/src/config.js b/src/config.js index 53b3cfb..69369e4 100644 --- a/src/config.js +++ b/src/config.js @@ -59,6 +59,7 @@ const tool = [ {'name': 'jwt', 'title': 'JWT解码', 'cat': ['conversion']}, {'name': 'hexString', 'title': 'Hex/String转换', 'cat': ['conversion']}, {'name': 'text', 'title': '文本处理', 'cat': ['other']}, + {'name': 'html', 'title': 'html编码', 'cat': ['conversion']}, ] // 工具类功能配置 diff --git a/src/tool.router.js b/src/tool.router.js index 927b865..b573452 100644 --- a/src/tool.router.js +++ b/src/tool.router.js @@ -133,6 +133,10 @@ const routes = [ { path: '/tool/text', component: r => require(['./views/tool/text.vue'], r) + }, + { + path: '/tool/html', + component: r => require(['./views/tool/html.vue'], r) } ] @@ -144,4 +148,4 @@ router.afterEach(to => { stat('tool', {tool: to.path}) }) -export default router \ No newline at end of file +export default router diff --git a/src/views/tool/html.vue b/src/views/tool/html.vue index 4de5abd..0ae3613 100644 --- a/src/views/tool/html.vue +++ b/src/views/tool/html.vue @@ -1,28 +1,22 @@