0👍
No need to pass data to the function, try something like below
methods: {
copyUrl() {
var cpLink = window.location.href;
cpLink.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';
console.log('Copy command was ' + msg);
} catch (err) {
console.log('Oops, unable to copy');
}
event.preventDefault;
}
}
- [Vuejs]-A links change size on click
- [Vuejs]-JQuery and Vuejs APIs not passing nor retrieving data to database Django
Source:stackexchange.com