File tree Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change 33
33
@click =" onBracketsClick"
34
34
/>
35
35
36
- <span v-else :class =" valueClass" v-html =" valueFormatter(node.content)" />
36
+ <span v-else-if =" customValueFormatter" v-html =" customFormatter(node.content)" ></span >
37
+ <span v-else :class =" valueClass" v-text =" defaultFormatter(node.content)" />
37
38
38
39
<span v-if =" showLength && collapsed" class =" vjs-comment" > // {{ node.length }} items </span >
39
40
</span >
@@ -131,18 +132,16 @@ export default {
131
132
defaultFormatter (data ) {
132
133
let text = data + ' ' ;
133
134
if (this .dataType === ' string' ) text = ` "${ text} "` ;
134
- return text;
135
- },
136
-
137
- valueFormatter (data ) {
138
- const basic = this .customValueFormatter
139
- ? this .customValueFormatter (
140
- data,
141
- this .node .key ,
142
- this .node .path ,
143
- this .defaultFormatter (data),
144
- )
145
- : this .defaultFormatter (data);
135
+ return this .node .showComma ? ` ${ text} ,` : text;
136
+ },
137
+
138
+ customFormatter (data ) {
139
+ const basic = this .customValueFormatter (
140
+ data,
141
+ this .node .key ,
142
+ this .node .path ,
143
+ this .defaultFormatter (data),
144
+ );
146
145
147
146
return this .node .showComma ? ` ${ basic} ,` : basic;
148
147
},
You can’t perform that action at this time.
0 commit comments