@@ -139,7 +139,14 @@ export default defineComponent({
139
139
} ,
140
140
} ,
141
141
142
- emits : [ 'nodeClick' , 'nodeMouseover' , 'bracketsClick' , 'iconClick' , 'selectedChange' , 'valueChange' ] ,
142
+ emits : [
143
+ 'nodeClick' ,
144
+ 'nodeMouseover' ,
145
+ 'bracketsClick' ,
146
+ 'iconClick' ,
147
+ 'selectedChange' ,
148
+ 'valueChange' ,
149
+ ] ,
143
150
144
151
setup ( props , { emit } ) {
145
152
const dataType = computed < string > ( ( ) => getDataType ( props . node . content ) ) ;
@@ -244,17 +251,21 @@ export default defineComponent({
244
251
const content = new Function ( 'data' , `return data${ path . slice ( rootPath . length ) } ` ) ( props . data ) ;
245
252
const copiedData = JSON . stringify ( key ? { [ key ] : content } : content , null , 2 ) ;
246
253
copy ( copiedData ) ;
247
- }
254
+ } ;
248
255
249
256
const renderNodeActions = ( ) => {
250
257
const render = props . renderNodeActions ;
251
258
if ( ! render ) return null ;
252
259
const defaultActions = {
253
260
copy : handleCopy ,
254
261
} ;
255
- return typeof render === 'function'
256
- ? render ( { node : props . node , defaultActions } )
257
- : < span onClick = { handleCopy } class = "vjs-tree-node-actions-item" > copy</ span > ;
262
+ return typeof render === 'function' ? (
263
+ render ( { node : props . node , defaultActions } )
264
+ ) : (
265
+ < span onClick = { handleCopy } class = "vjs-tree-node-actions-item" >
266
+ copy
267
+ </ span >
268
+ ) ;
258
269
} ;
259
270
260
271
return ( ) => {
@@ -295,7 +306,9 @@ export default defineComponent({
295
306
'has-line' : props . showLine ,
296
307
} }
297
308
>
298
- { Array . from ( Array ( props . indent ) ) . map ( ( ) => < > </ > ) }
309
+ { Array . from ( Array ( props . indent ) ) . map ( ( ) => (
310
+ < > </ >
311
+ ) ) }
299
312
</ div >
300
313
) ) }
301
314
{ props . showIcon && < Carets nodeType = { node . type } onClick = { handleIconClick } /> }
@@ -352,9 +365,7 @@ export default defineComponent({
352
365
</ span >
353
366
354
367
{ props . renderNodeActions && (
355
- < span class = "vjs-tree-node-actions" >
356
- { renderNodeActions ( ) }
357
- </ span >
368
+ < span class = "vjs-tree-node-actions" > { renderNodeActions ( ) } </ span >
358
369
) }
359
370
</ div >
360
371
) ;
0 commit comments