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:
@@ -94,6 +94,7 @@ export default {
|
|||||||
innerText: '['
|
innerText: '['
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
if (this.expand) {
|
||||||
this.ordered.forEach((value, key) => {
|
this.ordered.forEach((value, key) => {
|
||||||
elements.push(h(JsonBox, {
|
elements.push(h(JsonBox, {
|
||||||
key,
|
key,
|
||||||
@@ -108,6 +109,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.expand && this.value.length) {
|
if (!this.expand && this.value.length) {
|
||||||
elements.push(h('span', {
|
elements.push(h('span', {
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
if (this.expand) {
|
||||||
for (let key in this.ordered) {
|
for (let key in this.ordered) {
|
||||||
if (this.ordered.hasOwnProperty(key)) {
|
if (this.ordered.hasOwnProperty(key)) {
|
||||||
let value = this.ordered[key]
|
let value = this.ordered[key]
|
||||||
@@ -109,6 +110,7 @@ export default {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.expand && Object.keys(this.value).length) {
|
if (!this.expand && Object.keys(this.value).length) {
|
||||||
elements.push(h('span', {
|
elements.push(h('span', {
|
||||||
|
|||||||
+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