File tree Expand file tree Collapse file tree 2 files changed +26
-15
lines changed Expand file tree Collapse file tree 2 files changed +26
-15
lines changed Original file line number Diff line number Diff line change @@ -136,8 +136,13 @@ const importCode = computed(() => {
136
136
const messageOpen = ref (false );
137
137
let messageTimer;
138
138
139
+ function trackCopy (from ) {
140
+ va .track (" copy-code" , { from });
141
+ console .log (" copied" );
142
+ }
143
+
139
144
function copy () {
140
- va . track ( " copy-code " );
145
+ trackCopy ( " button " );
141
146
clearTimeout (messageTimer);
142
147
143
148
navigator .clipboard .writeText (importCode .value );
@@ -220,15 +225,16 @@ onBeforeUnmount(() => {
220
225
: disabled= " initializing"
221
226
autofocus
222
227
>< / textarea>
223
- < code- highlight
224
- class = " import-code"
225
- : language= " codegenOptions.includeType ? 'typescript' : 'javascript'"
226
- : code= " importCode"
227
- / >
228
+ < div class = " import-code" @copy= " trackCopy('system')" >
229
+ < code- highlight
230
+ : language= " codegenOptions.includeType ? 'typescript' : 'javascript'"
231
+ : code= " importCode"
232
+ / >
233
+ < / div>
228
234
< button
229
235
class = " copy"
230
236
@click= " copy"
231
- : disabled= " importCode.startsWith('/*')"
237
+ : disabled= " importCode.startsWith('/*') || importCode.startsWith('//') "
232
238
>
233
239
Copy
234
240
< / button>
@@ -307,8 +313,8 @@ input[type="number"] {
307
313
min- height: 0 ;
308
314
tab- size: 4 ;
309
315
310
- textarea ,
311
- pre {
316
+ . option - code ,
317
+ . import - code {
312
318
flex: 0 0 50 % ;
313
319
margin: 0 ;
314
320
border: none;
@@ -317,18 +323,24 @@ input[type="number"] {
317
323
overflow: auto;
318
324
}
319
325
320
- pre {
321
- padding: 0 ;
326
+ .import - code {
322
327
border- left: 1px solid rgba (0 , 0 , 0 , 0.1 );
323
- background: #fff;
324
- box- shadow: none;
328
+
329
+ pre {
330
+ width: 100 % ;
331
+ height: 100 % ;
332
+ margin: 0 ;
333
+ padding: 0 ;
334
+ background: #fff;
335
+ box- shadow: none;
336
+ }
325
337
326
338
code {
327
339
height: 100 % ;
328
340
}
329
341
}
330
342
331
- textarea {
343
+ . option - code {
332
344
padding: 1em ;
333
345
outline: none;
334
346
resize: none;
Original file line number Diff line number Diff line change @@ -187,7 +187,6 @@ pre {
187
187
padding : 0.8em ;
188
188
background-color : #f9f9f9 ;
189
189
box-shadow : 0 1px 2px rgba (0 , 0 , 0 , 0.125 );
190
- font-size : 0.8em ;
191
190
text-align : left ;
192
191
}
193
192
pre ,
You can’t perform that action at this time.
0 commit comments