mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
33 lines
825 B
Vue
33 lines
825 B
Vue
<template>
|
|
<div class="clipboard-copy">
|
|
<b-input-group size="lg" class="mb-3" prepend="Link">
|
|
<b-form-input :value="text" type="text" readonly></b-form-input>
|
|
<b-input-group-append>
|
|
<b-button size="sm" text="Button" variant="success" @click="CopyLink">
|
|
{{ $t('gdd_per_link.copy') }}
|
|
</b-button>
|
|
</b-input-group-append>
|
|
</b-input-group>
|
|
</div>
|
|
</template>
|
|
<script>
|
|
export default {
|
|
name: 'ClipboardCopy',
|
|
props: {
|
|
text: { type: String, required: true },
|
|
},
|
|
methods: {
|
|
CopyLink() {
|
|
navigator.clipboard
|
|
.writeText(this.url)
|
|
.then(() => {
|
|
this.toastSuccess(this.$t('gdd_per_link.link-copied'))
|
|
})
|
|
.catch(() => {
|
|
this.toastError(this.$t('gdd_per_link.not-copied'))
|
|
})
|
|
},
|
|
},
|
|
}
|
|
</script>
|