From f5639ffed94ffc49432d9f3d84841d7793ef77f0 Mon Sep 17 00:00:00 2001 From: baiy Date: Fri, 7 Jan 2022 11:45:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96diff=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/i18n/locales/en/diffs.i18n.json5 | 3 +- src/i18n/locales/zh_CN/diffs.i18n.json5 | 3 +- src/views/tool/code.vue | 13 +++ src/views/tool/components/diffEditor.vue | 101 +++++++--------------- src/views/tool/diffs.vue | 78 +++++++++-------- src/views/tool/library/formatter/index.js | 8 +- 7 files changed, 94 insertions(+), 114 deletions(-) diff --git a/package.json b/package.json index 496029b..d981284 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "c-tool", - "version": "1.10.0", + "version": "1.10.1", "private": true, "scripts": { "serve": "vue-cli-service serve --port 8081", diff --git a/src/i18n/locales/en/diffs.i18n.json5 b/src/i18n/locales/en/diffs.i18n.json5 index 18b8fdf..8cefb77 100644 --- a/src/i18n/locales/en/diffs.i18n.json5 +++ b/src/i18n/locales/en/diffs.i18n.json5 @@ -1,4 +1,5 @@ { "more": "More Languages", - "collapse":"Collapse Identical" + "collapse":"Collapse Identical", + "beautify":"Beautify" } diff --git a/src/i18n/locales/zh_CN/diffs.i18n.json5 b/src/i18n/locales/zh_CN/diffs.i18n.json5 index ded7f31..3152c7d 100644 --- a/src/i18n/locales/zh_CN/diffs.i18n.json5 +++ b/src/i18n/locales/zh_CN/diffs.i18n.json5 @@ -1,4 +1,5 @@ { "more": "更多语言", - "collapse":"折叠相同" + "collapse":"折叠相同", + "beautify":"格式化" } diff --git a/src/views/tool/code.vue b/src/views/tool/code.vue index b10c524..3fb1c62 100644 --- a/src/views/tool/code.vue +++ b/src/views/tool/code.vue @@ -52,6 +52,13 @@ export default { return data } }, + watch:{ + "current.isCompress"(){ + if (this.current.lang){ + this.handle(this.current.lang) + } + } + }, created() { this.$initToolData('content') }, @@ -77,6 +84,12 @@ export default { } } }, + isCompressChange(value){ + if (this.current.lang){ + console.log(value) + this.handle(this.current.lang) + } + } }, data() { return { diff --git a/src/views/tool/components/diffEditor.vue b/src/views/tool/components/diffEditor.vue index a2a0dee..c9d2798 100644 --- a/src/views/tool/components/diffEditor.vue +++ b/src/views/tool/components/diffEditor.vue @@ -1,8 +1,8 @@ + + diff --git a/src/views/tool/diffs.vue b/src/views/tool/diffs.vue index 1218a90..4abfbd5 100644 --- a/src/views/tool/diffs.vue +++ b/src/views/tool/diffs.vue @@ -1,47 +1,48 @@