2
0
mirror of https://github.com/tenrok/vue-json-viewer.git synced 2026-06-23 20:40:38 +03:00

Merge branch 'sort-object-keys' into 1.x

This commit is contained in:
STAFYNIAK Sacha
2018-09-17 07:37:25 +02:00
+3 -1
View File
@@ -24,9 +24,11 @@ export default {
ordered () { ordered () {
const ordered = {}; const ordered = {};
if (this.sortKeys) { if (this.sortKeys) {
Object.keys(this.jsonValue).sort().forEach(function(key) { Object.keys(this.jsonValue).sort().forEach(key => {
ordered[key] = this.jsonValue[key]; ordered[key] = this.jsonValue[key];
}); });
} else {
ordered = this.jsonValue
} }
return ordered; return ordered;
} }