1.实现复制粘贴功能
<template>
<el-button type="success" icon="CopyDocument" @click="copyLink()">专属链接</el-button>
</template>
// 1、下载vue-clipboard3
// 2、yarn add vue-clipboard3/npm install vue-clipboard3
import clipboard3 from 'vue-clipboard3'
const { toClipboard } = clipboard3()
// 复制专属连接
const copyLink = async() => {
let url = 'http://b.nmgca.com/index/index/wxlogin.html?business_id=1&tourl=http://192.168.8.12:8080/phone?serviceId=&rid=123';
await toClipboard(url)
ElMessage({
type: "success",
message: "复制链接成功!!!",
});
};