I am trying to use https://alligator.io/vuejs/vue-clipboard-copy/ for copy clip board feature in Vue.js, it is working fine for string but when I have an object, it is not copying properly. Below is the sample code.
<button v-clipboard:copy="test">Copy</button>
if test
is a simple string then I am getting that string properly copied to clipboard as abc
in this case.
data() {
return {
test: 'abc'
}
}
But when I give,
data() {
return {
test: {name: 'abc'}
}
}
I am getting [object object]
into my clipboard instead {name: 'abc'}