Skip to content

Commit 445a953

Browse files
committed
feat: allow copying current url in exception
1 parent 05c510a commit 445a953

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

packages/router/src/Exceptions/local/dist/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/router/src/Exceptions/local/src/sections/summary.vue

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script setup lang="ts">
2+
import { UseClipboard } from '@vueuse/components'
23
import { type ExceptionState } from '../store'
34
45
const $props = defineProps<{
@@ -56,11 +57,21 @@ function toFileSize(
5657
<!-- Badges -->
5758
<div class="flex flex-col items-end gap-2 font-mono shrink-0">
5859
<!-- URL and method -->
59-
<u-badge color="neutral" size="md" :label="uri">
60-
<template v-slot:leading>
61-
<span class="text-muted" v-text="method" />
62-
</template>
63-
</u-badge>
60+
<use-clipboard v-slot="{ copy, copied }" :source="uri">
61+
<u-tooltip :text="`Click to copy`">
62+
<u-badge
63+
:color="copied ? 'success' : 'neutral'"
64+
size="md"
65+
:label="uri"
66+
@click="copy"
67+
class="cursor-pointer select-none"
68+
>
69+
<template v-slot:leading>
70+
<span class="text-muted" v-text="method" />
71+
</template>
72+
</u-badge>
73+
</u-tooltip>
74+
</use-clipboard>
6475
<div class="flex items-center gap-x-2">
6576
<!-- Status -->
6677
<u-badge

0 commit comments

Comments
 (0)