From 3d4a0f49c570c91bd5edcb7ac3e596d64d135b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B3=B0?= Date: Tue, 27 Aug 2019 16:42:52 +0800 Subject: [PATCH] fix array with 0 or '' --- lib/types/json-array.vue | 3 +-- package.json | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/types/json-array.vue b/lib/types/json-array.vue index a1e4769..7cc3901 100644 --- a/lib/types/json-array.vue +++ b/lib/types/json-array.vue @@ -51,7 +51,7 @@ export default { setTimeout(() => { this.value.push(vals[index]); - if (vals[index + 1]) { + if (this.value.length < vals.length) { this.setValue(vals, index + 1); } }, 0); @@ -94,7 +94,6 @@ export default { innerHTML: '[' } })) - this.ordered.forEach((value, key) => { elements.push(h(JsonBox, { key, diff --git a/package.json b/package.json index a0fc83c..cd2c0e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-json-viewer", - "version": "2.2.1", + "version": "2.2.2", "description": "vuejs展示json的组件", "main": "vue-json-viewer.js", "files": [