2
0
mirror of https://github.com/tenrok/vue-json-viewer.git synced 2026-06-20 20:00:37 +03:00

feat: support showArrayIndex

This commit is contained in:
fengqi.cf
2021-12-18 15:43:44 +08:00
parent 9612c2f2d0
commit 343bad03b4
5 changed files with 14 additions and 2 deletions
+3 -1
View File
@@ -20,6 +20,7 @@ export default {
expand: Boolean,
forceExpand: Boolean,
previewMode: Boolean,
showArrayIndex: Boolean,
},
data() {
return {
@@ -101,11 +102,12 @@ export default {
key,
props: {
sort: this.sort,
keyName: `${key}`,
keyName: this.showArrayIndex ? `${key}`: '',
depth: this.depth + 1,
value,
previewMode: this.previewMode,
forceExpand: this.forceExpand,
showArrayIndex: this.showArrayIndex,
}
}))
})
+2
View File
@@ -20,6 +20,7 @@ export default {
forceExpand: Boolean,
sort: Boolean,
previewMode: Boolean,
showArrayIndex: Boolean,
},
data() {
return {
@@ -117,6 +118,7 @@ export default {
value,
previewMode: this.previewMode,
forceExpand: this.forceExpand,
showArrayIndex: this.showArrayIndex,
}
}))
}