Support String type for CopyTextField

This commit is contained in:
Matthias 2023-06-21 07:10:13 +02:00
parent 572396c3d1
commit d112c65800

View File

@ -4,7 +4,7 @@
v-if="isSupported && isValid"
role="button"
class="copy-button position-absolute end-0 mt-1 me-2"
@click="copy(content)"
@click="copy(typeof content === 'string' ? content : JSON.stringify(content))"
/>
<pre class="text-start border p-1 mb-0"><code>{{ content }}</code></pre>
</div>
@ -14,7 +14,7 @@
import { useClipboard } from '@vueuse/core';
defineProps({
content: { type: String, required: true },
content: { type: [String, Array<string>], required: true },
isValid: { type: Boolean, default: true },
});