Browse Source

json bug fix

zxlie 7 years ago
parent
commit
27051c73bc
2 changed files with 6 additions and 3 deletions
  1. 5 2
      apps/json-format/index.js
  2. 1 1
      apps/manifest.json

+ 5 - 2
apps/json-format/index.js

@@ -50,6 +50,7 @@ new Vue({
             }
         };
         editor.on('change', (editor, changes) => {
+            this.jsonFormattedSource = editor.getValue().replace(/\n/gm, ' ');
             this.fireChange && this.format();
         });
 
@@ -74,7 +75,7 @@ new Vue({
 
             let source = editor.getValue().replace(/\n/gm, ' ');
             if (!source) {
-                return true;
+                return false;
             }
 
             // JSONP形式下的callback name
@@ -142,9 +143,11 @@ new Vue({
                     return this.lintOn();
                 } else {
                     this.resultContent = '<span class="x-error">' + this.errorMsg + '</span>';
-                    return true;
+                    return false;
                 }
             }
+
+            return true;
         },
 
         compress: function () {

+ 1 - 1
apps/manifest.json

@@ -1,6 +1,6 @@
 {
   "name": "WEB前端助手(FeHelper)",
-  "version": "2018.07.0314",
+  "version": "2018.07.0514",
   "manifest_version": 2,
   "default_locale": "zh_CN",
   "description": "FE助手:包括JSON格式化、二维码生成与解码、信息编解码、代码压缩、美化、页面取色、Markdown与HTML互转、网页滚动截屏、正则表达式、时间转换工具、编码规范检测、页面性能检测、Ajax接口调试、密码生成器",