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

Merge branch 'add-null-value' into 1.x

This commit is contained in:
STAFYNIAK Sacha
2018-09-17 06:50:21 +02:00
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -11,7 +11,7 @@
<script> <script>
import JIcon from './json-icon' import JIcon from './json-icon'
import JsonString from './types/json-string'; import JsonString from './types/json-string';
import JsonNull from './types/json-null'; import JsonUndefined from './types/json-undefined';
import JsonNumber from './types/json-number'; import JsonNumber from './types/json-number';
import JsonBoolean from './types/json-boolean'; import JsonBoolean from './types/json-boolean';
import JsonObject from './types/json-object'; import JsonObject from './types/json-object';
@@ -37,7 +37,7 @@ export default {
computed: { computed: {
valueType() { valueType() {
if (this.value === null || this.value === undefined) { if (this.value === null || this.value === undefined) {
return 'Null'; return 'Undefined';
} else if (Array.isArray(this.value)) { } else if (Array.isArray(this.value)) {
return 'Array'; return 'Array';
} else if (typeof this.value === 'object') { } else if (typeof this.value === 'object') {
@@ -63,7 +63,7 @@ export default {
JsonObject, JsonObject,
JsonArray, JsonArray,
JsonFunction, JsonFunction,
JsonNull, JsonUndefined,
JIcon JIcon
} }
}; };
@@ -1,10 +1,10 @@
<template> <template>
<span class="json-null">{{ jsonValue === null ? 'null' : 'undefined' }}</span> <span class="json-undefined">{{ jsonValue === null ? 'null' : 'undefined' }}</span>
</template> </template>
<script> <script>
export default { export default {
name: 'JsonNull', name: 'JsonUndefined',
props: { props: {
jsonValue: Object jsonValue: Object
} }
@@ -12,7 +12,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.json-null { .json-undefined {
color: #e08331; color: #e08331;
} }
</style> </style>