Copy
<template>
<vs-input v-model="text2" class="inline-flex" />
<vs-button @click="copyText">Copy</vs-button>
</template>
<script>
export default {
data() {
return {
text2: 'Copy Me Without Directive',
}
},
methods: {
copyText() {
const thisIns = this;
this.$copyText(this.text2).then(function() {
thisIns.$vs.notify({
title: 'Success',
text: 'Text copied successfully',
color: 'success',
iconPack: 'feather',
position: 'top-center',
icon: 'icon-check-circle'
})
}, function() {
thisIns.$vs.notify({
title: 'Failed',
text: 'Error in copying text',
color: 'danger',
iconPack: 'feather',
position: 'top-center',
icon: 'icon-alert-circle'
})
})
}
}
}
</script>