mirror of
https://github.com/tenrok/vue-json-viewer.git
synced 2026-06-08 17:22:32 +03:00
add an option to enable key sorting before display
This commit is contained in:
@@ -24,9 +24,11 @@ export default {
|
||||
ordered () {
|
||||
const ordered = {};
|
||||
if (this.sortKeys) {
|
||||
Object.keys(this.jsonValue).sort().forEach(function(key) {
|
||||
Object.keys(this.jsonValue).sort().forEach(key => {
|
||||
ordered[key] = this.jsonValue[key];
|
||||
});
|
||||
} else {
|
||||
ordered = this.jsonValue
|
||||
}
|
||||
return ordered;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user