diff --git a/src/views/home/HomeForm.vue b/src/views/home/HomeForm.vue index f38ccb6..c6e4771 100644 --- a/src/views/home/HomeForm.vue +++ b/src/views/home/HomeForm.vue @@ -106,7 +106,7 @@ -
+
+
+ +
@@ -258,6 +268,28 @@ export default { this.getFinalUrl(); } }, + toCopy() { + if (!this.returnUrl) { + this.dialogMessage = '内容为空,请先订阅转换.'; + this.dialogVisible = true; + } else { + var copyInput = document.createElement('input'); + copyInput.setAttribute('value', this.returnUrl); + document.body.appendChild(copyInput); + copyInput.select(); + try { + var copyed = document.execCommand('copy'); + if (copyed) { + document.body.removeChild(copyInput); + this.dialogMessage = '复制成功'; + this.dialogVisible = true; + } + } catch { + this.dialogMessage = '复制失败,请检查浏览器兼容.'; + this.dialogVisible = true; + } + } + }, }, };