a1300399510@qq.com 提交于 2023/03/31 -16:20:01
This commit is contained in:
@@ -27,8 +27,24 @@ function goTologin() {
|
||||
}
|
||||
|
||||
// 点击复制
|
||||
function copy(value, ismessage) {
|
||||
function copy(value, message) {
|
||||
// 创建一个新的输入元素
|
||||
let copyInput = document.createElement('input');
|
||||
// 将输入元素添加到文档的主体中
|
||||
document.body.appendChild(copyInput);
|
||||
// 将输入元素的值设置为需要复制的URL
|
||||
copyInput.setAttribute('value', value);
|
||||
// 选择输入元素
|
||||
copyInput.select();
|
||||
// 使用clipboard API将所选文本复制到剪贴板
|
||||
navigator.clipboard.writeText(copyInput.value);
|
||||
// 向用户显示成功消息
|
||||
// 从文档中删除动态创建的输入元素
|
||||
copyInput.remove();
|
||||
|
||||
if (message) this.$message.success(message);
|
||||
|
||||
|
||||
}
|
||||
|
||||
export { skipUrl, pageStop, pageMove, goTologin, copy }
|
||||
Reference in New Issue
Block a user