npm install vue-clipboard2 -s
在这里插入图片描述在main里面 引入

在这里插入图片描述

CopyLink(){
      this.$copyText(`链接:${this.link} 提取码:${this.ExtractCode}`).then( (e)=> {
        this.$notify({
          title: '成功',
          message: '复制成功',
          type: 'success'
        });
        console.log(e)
      },(e)=>{
        this.$notify({
          title: '失败',
          message: '复制失败,请手动复制',
          type: 'success'
        });

      })
    },
Logo

前往低代码交流专区

更多推荐