import clipboard from 'clipboard';
data() {
return {
text: "",
};
},
<div class="blue-size ma-bof12 border-black">{ {text}}<br> <button @click="copyText" class="copy" size="mini">复制链接</button> </div>
copyText() {
const input = document.createElement('input');
input.value = this.text; // 设置要复制的文本
document.body.appendChild(input); // 添加input元素
input.select(); // 选中文本
document.execCommand('copy'); // 执行复制操作
document.body.removeChild(input); // 移除input元素
alert('内容已复制到剪贴板');
},
判断文件类型
handleRemove2(file, fileList) {
// console.log(file, file