diff --git a/lib/types/json-object.vue b/lib/types/json-object.vue index e8f1e42..cd694c8 100644 --- a/lib/types/json-object.vue +++ b/lib/types/json-object.vue @@ -115,6 +115,8 @@ export default { if (this.ordered.hasOwnProperty(key)) { let value = this.ordered[key] + const path = key.includes(" ") ? `${this.path}['${key}']` : `${this.path}.${key}`; + elements.push(h(JsonBox, { key, props: { @@ -126,7 +128,7 @@ export default { forceExpand: this.forceExpand, showArrayIndex: this.showArrayIndex, showDoubleQuotes: this.showDoubleQuotes, - path: `${this.path}.${key}`, + path, clickable: this.clickable, }, on: { diff --git a/package-lock.json b/package-lock.json index 5ba4597..f26f065 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vue-json-viewer", - "version": "2.2.22", + "version": "2.2.24", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1524,6 +1524,16 @@ "dev": true, "optional": true }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "block-stream": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", @@ -3889,6 +3899,13 @@ } } }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, "filesize": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/filesize/-/filesize-3.6.1.tgz", @@ -10507,6 +10524,7 @@ "dev": true, "optional": true, "requires": { + "bindings": "^1.5.0", "nan": "^2.12.1" } }, @@ -10811,6 +10829,7 @@ "dev": true, "optional": true, "requires": { + "bindings": "^1.5.0", "nan": "^2.12.1" } }, diff --git a/package.json b/package.json index eab1dd5..f4b61c0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-json-viewer", - "version": "2.2.23", + "version": "2.2.24", "description": "vuejs展示json的组件", "main": "vue-json-viewer.js", "files": [