athenianCopy(value){
if (value == "" || value == null || value == undefined) {
this.$message({
showClose: true,
message: "无信息,复制失败!",
type: "error",
offset: "80"
});
return;
}
var input = document.createElement("input"); // 直接构建input
input.value = value; // 设置内容
document.body.appendChild(input); // 添加临时实例
input.select(); // 选择实例内容
document.execCommand("Copy"); // 执行复制
this.$message({
showClose: true,
message: "复制成功",
type: "success",
offset: "100"
});
document.body.removeChild(input); // 删除临时实例
}
复制数据到剪切框
最新推荐文章于 2024-05-31 14:49:19 发布