|
@@ -28,7 +28,14 @@
|
|
请在电脑浏览器中打开以上链接进行直播
|
|
请在电脑浏览器中打开以上链接进行直播
|
|
</p>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
- <div class="shareBtn shareText" @click="copyText">复制分享内容</div>
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="shareBtn shareText"
|
|
|
|
+ data-clipboard-action="copy"
|
|
|
|
+ data-clipboard-target=".shareBtn"
|
|
|
|
+ @click="copyText"
|
|
|
|
+ >
|
|
|
|
+ 复制分享内容
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
<div class="codeWrap" v-if="form.shareType == 2">
|
|
<div class="codeWrap" v-if="form.shareType == 2">
|
|
<div class="shareWrap">
|
|
<div class="shareWrap">
|
|
@@ -64,13 +71,10 @@ export default {
|
|
content: "",
|
|
content: "",
|
|
url: "",
|
|
url: "",
|
|
Teacherurl: "",
|
|
Teacherurl: "",
|
|
- clipboard:null
|
|
|
|
|
|
+ clipboard: null,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.clipboard = new Clipboard(".shareText",{
|
|
|
|
- target:this.copyText()
|
|
|
|
- });
|
|
|
|
this.url =
|
|
this.url =
|
|
vaildStudentUrl() + `/#/liveClassTransfer?roomUid=${this.row.roomUid}`;
|
|
vaildStudentUrl() + `/#/liveClassTransfer?roomUid=${this.row.roomUid}`;
|
|
let domain = window.location.domain;
|
|
let domain = window.location.domain;
|
|
@@ -95,6 +99,25 @@ export default {
|
|
}\n直播地址:${this.url}\n`;
|
|
}\n直播地址:${this.url}\n`;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ var clipboard = new Clipboard(".shareText", {
|
|
|
|
+ text: function (trigger) {
|
|
|
|
+ return text;
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ clipboard.on("success", (e) => {
|
|
|
|
+ console.log("复制成功");
|
|
|
|
+ this.$message.success("复制成功");
|
|
|
|
+ this.$emit("close");
|
|
|
|
+ // 释放内存
|
|
|
|
+ clipboard.destroy();
|
|
|
|
+ });
|
|
|
|
+ clipboard.on("error", (e) => {
|
|
|
|
+ // 不支持复制
|
|
|
|
+ console.log("该浏览器不支持自动复制");
|
|
|
|
+ // 释放内存
|
|
|
|
+ clipboard.destroy();
|
|
|
|
+ });
|
|
|
|
+
|
|
// if (text) {
|
|
// if (text) {
|
|
|
|
|
|
// console.log(clipboard)
|
|
// console.log(clipboard)
|
|
@@ -107,7 +130,7 @@ export default {
|
|
// e.clearSelection();
|
|
// e.clearSelection();
|
|
// });
|
|
// });
|
|
// }
|
|
// }
|
|
- return text
|
|
|
|
|
|
+ // return text
|
|
},
|
|
},
|
|
|
|
|
|
shareImage() {
|
|
shareImage() {
|