🎉 Init
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<template>
|
||||
<div>
|
||||
<FieldLabel>{{ label }}</FieldLabel>
|
||||
<div class="mt-1 flex items-center gap-2">
|
||||
<p class="break-all font-mono text-sm text-text">{{ value }}</p>
|
||||
<button
|
||||
type="button"
|
||||
class="shrink-0 text-muted transition-colors hover:text-accent"
|
||||
:title="`${label} kopieren`"
|
||||
@click="copy"
|
||||
>
|
||||
<span class="material-symbols-outlined !text-[16px]">{{ copied ? 'check' : 'content_copy' }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
|
||||
const props = defineProps<{ label: string; value: string }>()
|
||||
const copied = ref(false)
|
||||
|
||||
async function copy() {
|
||||
await navigator.clipboard.writeText(props.value)
|
||||
copied.value = true
|
||||
setTimeout(() => { copied.value = false }, 1500)
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user