✨ Added native share feature
This commit is contained in:
@@ -690,14 +690,24 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
copyRequest() {
|
copyRequest() {
|
||||||
this.$refs.copyRequest.innerHTML = this.copiedButton + '<span>Copied</span>';
|
if (navigator.share) {
|
||||||
var dummy = document.createElement('input');
|
navigator.share({
|
||||||
document.body.appendChild(dummy);
|
title: document.title,
|
||||||
dummy.value = window.location.href;
|
url: window.location.href
|
||||||
dummy.select();
|
}).then(() => {
|
||||||
document.execCommand('copy');
|
// console.log('Thanks for sharing!');
|
||||||
document.body.removeChild(dummy);
|
})
|
||||||
setTimeout(() => this.$refs.copyRequest.innerHTML = this.copyButton + '<span>Share URL</span>', 1500)
|
.catch(console.error);
|
||||||
|
} else {
|
||||||
|
this.$refs.copyRequest.innerHTML = this.copiedButton + '<span>Copied</span>';
|
||||||
|
var dummy = document.createElement('input');
|
||||||
|
document.body.appendChild(dummy);
|
||||||
|
dummy.value = window.location.href;
|
||||||
|
dummy.select();
|
||||||
|
document.execCommand('copy');
|
||||||
|
document.body.removeChild(dummy);
|
||||||
|
setTimeout(() => this.$refs.copyRequest.innerHTML = this.copyButton + '<span>Share URL</span>', 1500)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
copyRequestCode() {
|
copyRequestCode() {
|
||||||
this.$refs.copyRequestCode.innerHTML = this.copiedButton + '<span>Copied</span>';
|
this.$refs.copyRequestCode.innerHTML = this.copiedButton + '<span>Copied</span>';
|
||||||
|
|||||||
Reference in New Issue
Block a user