File tree 1 file changed +26
-2
lines changed
packages/app-frontend/src/features/components 1 file changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -41,13 +41,27 @@ export default defineComponent({
41
41
42
42
const sameApp = computed (() => selectedComponent .data .value ?.id .split (' :' )[0 ] === selectedComponentId .value ?.split (' :' )[0 ])
43
43
44
+ // Copy component name
45
+ const showCopiedName = ref (false )
46
+ let copiedNameTimeout
47
+ function copyName () {
48
+ navigator .clipboard .writeText (displayName .value )
49
+ showCopiedName .value = true
50
+ clearTimeout (copiedNameTimeout )
51
+ copiedNameTimeout = setTimeout (() => {
52
+ showCopiedName .value = false
53
+ }, 1000 )
54
+ }
55
+
44
56
return {
45
57
... selectedComponent ,
46
58
displayName ,
47
59
showRenderCode ,
48
60
inspector ,
49
61
stateFilterInput ,
50
62
sameApp ,
63
+ copyName ,
64
+ showCopiedName ,
51
65
}
52
66
},
53
67
})
@@ -59,13 +73,23 @@ export default defineComponent({
59
73
class =" h-full flex flex-col relative"
60
74
>
61
75
<div class =" px-2 h-10 border-b border-gray-200 dark:border-gray-800 flex items-center flex-none" >
62
- <div class =" flex items-baseline" >
76
+ <VTooltip
77
+ :shown =" showCopiedName"
78
+ :triggers =" []"
79
+ :delay =" 0"
80
+ class =" flex items-baseline cursor-pointer"
81
+ @click.native =" copyName()"
82
+ >
63
83
<span class =" text-gray-500" >< ; </span >
64
84
<span class =" text-green-500" >
65
85
{{ displayName }}
66
86
</span >
67
87
<span class =" text-gray-500" >> ; </span >
68
- </div >
88
+
89
+ <template #popper >
90
+ Copied!
91
+ </template >
92
+ </VTooltip >
69
93
70
94
<VueInput
71
95
ref =" stateFilterInput"
You can’t perform that action at this time.
0 commit comments