From 343bad03b4c5a03d1e785b354319347df4b4754c Mon Sep 17 00:00:00 2001 From: "fengqi.cf" Date: Sat, 18 Dec 2021 15:43:44 +0800 Subject: [PATCH] feat: support showArrayIndex --- example/app.js | 1 + lib/json-box.vue | 4 +++- lib/json-viewer.vue | 5 +++++ lib/types/json-array.vue | 4 +++- lib/types/json-object.vue | 2 ++ 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/example/app.js b/example/app.js index 5500ea1..4409a71 100644 --- a/example/app.js +++ b/example/app.js @@ -40,6 +40,7 @@ new Vue({ align: 'left' }} boxed + show-array-index={false} timeformat={time => new Date(time)} sort>
diff --git a/lib/json-box.vue b/lib/json-box.vue index 1c4b23c..8afb4bf 100644 --- a/lib/json-box.vue +++ b/lib/json-box.vue @@ -27,6 +27,7 @@ export default { }, previewMode: Boolean, forceExpand: Boolean, + showArrayIndex: Boolean, }, data() { return { @@ -134,7 +135,8 @@ export default { depth: this.depth, expand: this.expand, previewMode: this.previewMode, - forceExpand: this.forceExpandMe + forceExpand: this.forceExpandMe, + showArrayIndex: this.showArrayIndex, }, on: { 'update:expand': value => { diff --git a/lib/json-viewer.vue b/lib/json-viewer.vue index 3f31385..5365041 100644 --- a/lib/json-viewer.vue +++ b/lib/json-viewer.vue @@ -29,6 +29,7 @@ :value="value" :sort="sort" :preview-mode="previewMode" + :show-array-index="showArrayIndex" />