mirror of
https://github.com/tenrok/vue-json-viewer.git
synced 2026-06-20 20:00:37 +03:00
Merge pull request #15 from s-mage/master
Improve displaying of objects and arrays
This commit is contained in:
@@ -69,13 +69,11 @@ export default {
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
for (let key in this.ordered) {
|
this.ordered.forEach((value, key) => {
|
||||||
let value = this.ordered[key]
|
|
||||||
|
|
||||||
elements.push(h(JsonBox, {
|
elements.push(h(JsonBox, {
|
||||||
key,
|
key,
|
||||||
style: {
|
style: {
|
||||||
display: !this.expand ? 'none' : undefined
|
display: this.expand ? undefined : 'none'
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
sort: this.sort,
|
sort: this.sort,
|
||||||
@@ -84,12 +82,12 @@ export default {
|
|||||||
value,
|
value,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
}
|
})
|
||||||
|
|
||||||
if (!this.expand) {
|
if (!this.expand && this.jsonValue.length) {
|
||||||
elements.push(h('span', {
|
elements.push(h('span', {
|
||||||
style: {
|
style: {
|
||||||
display: this.expand ? 'none' : undefined
|
display: undefined
|
||||||
},
|
},
|
||||||
class: {
|
class: {
|
||||||
'jv-ellipsis': true,
|
'jv-ellipsis': true,
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.expand) {
|
if (!this.expand && Object.keys(this.jsonValue).length) {
|
||||||
elements.push(h('span', {
|
elements.push(h('span', {
|
||||||
style: {
|
style: {
|
||||||
display: this.expand ? 'none' : undefined
|
display: this.expand ? 'none' : undefined
|
||||||
|
|||||||
Reference in New Issue
Block a user