mirror of
https://github.com/tenrok/vue-json-viewer.git
synced 2026-06-23 20:40:38 +03:00
feat: array not sort
This commit is contained in:
@@ -24,17 +24,6 @@ export default {
|
|||||||
sort: Boolean,
|
sort: Boolean,
|
||||||
expand: Boolean
|
expand: Boolean
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
ordered () {
|
|
||||||
let value = this.value
|
|
||||||
|
|
||||||
if (!this.sort) {
|
|
||||||
return value
|
|
||||||
}
|
|
||||||
|
|
||||||
return value.sort()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
watch: {
|
||||||
jsonValue(newVal) {
|
jsonValue(newVal) {
|
||||||
this.setValue(newVal);
|
this.setValue(newVal);
|
||||||
@@ -94,7 +83,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
if (this.expand) {
|
if (this.expand) {
|
||||||
this.ordered.forEach((value, key) => {
|
this.value.forEach((value, key) => {
|
||||||
elements.push(h(JsonBox, {
|
elements.push(h(JsonBox, {
|
||||||
key,
|
key,
|
||||||
style: {
|
style: {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-json-viewer",
|
"name": "vue-json-viewer",
|
||||||
"version": "2.2.10",
|
"version": "2.2.11",
|
||||||
"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