mirror of
https://github.com/tenrok/vue-json-viewer.git
synced 2026-06-23 20:40:38 +03:00
feat: Optimize memory
This commit is contained in:
+16
-14
@@ -94,20 +94,22 @@ export default {
|
|||||||
innerText: '['
|
innerText: '['
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
this.ordered.forEach((value, key) => {
|
if (this.expand) {
|
||||||
elements.push(h(JsonBox, {
|
this.ordered.forEach((value, key) => {
|
||||||
key,
|
elements.push(h(JsonBox, {
|
||||||
style: {
|
key,
|
||||||
display: this.expand ? undefined : 'none'
|
style: {
|
||||||
},
|
display: this.expand ? undefined : 'none'
|
||||||
props: {
|
},
|
||||||
sort: this.sort,
|
props: {
|
||||||
// keyName: key,
|
sort: this.sort,
|
||||||
depth: this.depth + 1,
|
// keyName: key,
|
||||||
value,
|
depth: this.depth + 1,
|
||||||
}
|
value,
|
||||||
}))
|
}
|
||||||
})
|
}))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.expand && this.value.length) {
|
if (!this.expand && this.value.length) {
|
||||||
elements.push(h('span', {
|
elements.push(h('span', {
|
||||||
|
|||||||
+17
-15
@@ -91,22 +91,24 @@ export default {
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
for (let key in this.ordered) {
|
if (this.expand) {
|
||||||
if (this.ordered.hasOwnProperty(key)) {
|
for (let key in this.ordered) {
|
||||||
let value = this.ordered[key]
|
if (this.ordered.hasOwnProperty(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 ? 'none' : undefined
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
sort: this.sort,
|
sort: this.sort,
|
||||||
keyName: key,
|
keyName: key,
|
||||||
depth: this.depth + 1,
|
depth: this.depth + 1,
|
||||||
value,
|
value,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-json-viewer",
|
"name": "vue-json-viewer",
|
||||||
"version": "2.2.3",
|
"version": "2.2.4",
|
||||||
"description": "vuejs展示json的组件",
|
"description": "vuejs展示json的组件",
|
||||||
"main": "vue-json-viewer.js",
|
"main": "vue-json-viewer.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
Reference in New Issue
Block a user