Skip to content

Commit b586c3c

Browse files
author
grzegorzpro
authored
[MCTB-7383] Fix paths with spaces (#3)
1 parent 1237a8c commit b586c3c

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

lib/types/json-object.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ export default {
115115
if (this.ordered.hasOwnProperty(key)) {
116116
let value = this.ordered[key]
117117
118+
const path = key.includes(" ") ? `${this.path}['${key}']` : `${this.path}.${key}`;
119+
118120
elements.push(h(JsonBox, {
119121
key,
120122
props: {
@@ -126,7 +128,7 @@ export default {
126128
forceExpand: this.forceExpand,
127129
showArrayIndex: this.showArrayIndex,
128130
showDoubleQuotes: this.showDoubleQuotes,
129-
path: `${this.path}.${key}`,
131+
path,
130132
clickable: this.clickable,
131133
},
132134
on: {

package-lock.json

Lines changed: 20 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-json-viewer",
3-
"version": "2.2.23",
3+
"version": "2.2.24",
44
"description": "vuejs展示json的组件",
55
"main": "vue-json-viewer.js",
66
"files": [

0 commit comments

Comments
 (0)