Skip to content

Commit 7903740

Browse files
authored
feat(server-routes): copy url button (#389)
1 parent 103419e commit 7903740

1 file changed

Lines changed: 19 additions & 6 deletions

File tree

packages/devtools/client/components/ServerRouteDetails.vue

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ watchEffect(() => {
289289
routeInputBodyJSON.value = JSON.parse(routeInputBodyJSON.value)
290290
}
291291
})
292+
293+
const copy = useCopy()
292294
</script>
293295

294296
<template>
@@ -303,12 +305,23 @@ watchEffect(() => {
303305
{{ method.toUpperCase() }}
304306
</option>
305307
</NSelect>
306-
<NTextInput
307-
:model-value="finalPath"
308-
disabled flex-auto font-mono
309-
p="x5 y2"
310-
n="primary xs"
311-
/>
308+
<div relative w-full>
309+
<NTextInput
310+
:model-value="finalPath"
311+
disabled flex-auto font-mono
312+
p="x5 y2"
313+
n="primary xs"
314+
/>
315+
<NButton
316+
v-tooltip="'Copy URL'"
317+
title="Copy URL"
318+
absolute right-2 top-1.7
319+
n="xs blue"
320+
@click="copy(finalURL)"
321+
>
322+
<NIcon icon="carbon:copy" />
323+
</NButton>
324+
</div>
312325
<NButton n="primary solid" @click="fetchData">
313326
<NIcon icon="carbon:send" />
314327
</NButton>

0 commit comments

Comments
 (0)