open-nomad/ui/app/components/json-viewer.js

17 lines
455 B
JavaScript
Raw Normal View History

import Component from '@ember/component';
import { computed } from '@ember/object';
import { classNames, classNameBindings } from '@ember-decorators/component';
import classic from 'ember-classic-decorator';
2017-09-19 14:47:10 +00:00
@classic
@classNames('json-viewer')
@classNameBindings('fluidHeight:has-fluid-height')
export default class JsonViewer extends Component {
json = null;
2017-09-19 14:47:10 +00:00
@computed('json')
get jsonStr() {
2019-03-26 07:46:44 +00:00
return JSON.stringify(this.json, null, 2);
}
}