Copy
<template>
<vs-input v-model="text" class="inline-flex" />
<vs-button
v-clipboard:copy="text"
v-clipboard:success="onCopy"
v-clipboard:error="onError">
Copy
</vs-button>
</template>
<script>
export default {
data() {
return {
text: 'Copy Me!',
}
},
methods: {
onCopy() {
this.$vs.notify({
title: 'Success',
text: 'Text copied successfully',
color: 'success',
iconPack: 'feather',
position: 'top-center',
icon: 'icon-check-circle'
})
},
onError() {
this.$vs.notify({
title: 'Failed',
text: 'Error in copying text',
color: 'danger',
iconPack: 'feather',
position: 'top-center',
icon: 'icon-alert-circle'
})
},
}
}
</script>