File tree 8 files changed +25
-9
lines changed
8 files changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,9 @@ import VueJsonPretty from 'src';
93
93
94
94
const defaultData = {
95
95
status: 200 ,
96
- error: ' ' ,
96
+ text: ' ' ,
97
+ error: null ,
98
+ config: undefined ,
97
99
data: [
98
100
{
99
101
news_id: 51184 ,
Original file line number Diff line number Diff line change @@ -55,7 +55,9 @@ import VueJsonPretty from 'src';
55
55
56
56
const defaultData = {
57
57
status: 200 ,
58
- error: ' ' ,
58
+ text: ' ' ,
59
+ error: null ,
60
+ config: undefined ,
59
61
data: [
60
62
{
61
63
news_id: 51184 ,
Original file line number Diff line number Diff line change @@ -105,7 +105,9 @@ import VueJsonPretty from 'src';
105
105
106
106
const defaultData = {
107
107
status: 200 ,
108
- error: ' ' ,
108
+ text: ' ' ,
109
+ error: null ,
110
+ config: undefined ,
109
111
data: [
110
112
{
111
113
news_id: 51184 ,
Original file line number Diff line number Diff line change @@ -47,7 +47,9 @@ import VueJsonPretty from 'src';
47
47
48
48
const defaultData = {
49
49
status: 200 ,
50
- error: ' ' ,
50
+ text: ' ' ,
51
+ error: null ,
52
+ config: undefined ,
51
53
data: Array .from (Array (1000 )).map ((item , index ) => ({
52
54
news_id: index,
53
55
title: ' iPhone X Review: Innovative future with real black technology' ,
Original file line number Diff line number Diff line change @@ -175,9 +175,11 @@ export default {
175
175
},
176
176
177
177
defaultValue () {
178
- const str = (this .node ? .content ?? ' ' ) + ' ' ;
179
- const text = this .dataType === ' string' ? ` "${ str} "` : str;
180
- return text;
178
+ let value = this .node ? .content ;
179
+ if (value === null || value === undefined ) {
180
+ value += ' ' ;
181
+ }
182
+ return this .dataType === ' string' ? ` "${ value} "` : value
181
183
},
182
184
},
183
185
methods: {
Original file line number Diff line number Diff line change 55
55
.gen-value-style (@color-null );
56
56
}
57
57
58
+ .@{css-prefix} -value-undefined {
59
+ .gen-value-style (@color-undefined );
60
+ }
61
+
58
62
.@{css-prefix} -value-number {
59
63
.gen-value-style (@color-number );
60
64
}
Original file line number Diff line number Diff line change 6
6
@color-info : #1d8ce0 ;
7
7
@color-error : #ff4949 ;
8
8
@color-success : #13ce66 ;
9
+ @color-nil : #D55FDE ;
9
10
10
11
/* field values color */
11
12
@color-string : @color-success ;
12
13
@color-number : @color-info ;
13
14
@color-boolean : @color-info ;
14
- @color-null : @color-error ;
15
+ @color-null : @color-nil ;
16
+ @color-undefined : @color-nil ;
15
17
16
18
/* highlight */
17
19
@highlight-bg-color : #e6f7ff ;
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ export function arrFlat(arr) {
84
84
}
85
85
86
86
export function cloneDeep ( source , hash = new WeakMap ( ) ) {
87
- if ( source === null ) return source ;
87
+ if ( source === null || source === undefined ) return source ;
88
88
if ( source instanceof Date ) return new Date ( source ) ;
89
89
if ( source instanceof RegExp ) return new RegExp ( source ) ;
90
90
if ( typeof source !== 'object' ) return source ;
You can’t perform that action at this time.
0 commit comments