mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-14 05:16:43 +08:00
外链
This commit is contained in:
@@ -91,8 +91,9 @@
|
|||||||
<div v-if="resType == 52">
|
<div v-if="resType == 52">
|
||||||
<div v-if="contentData.content != ''">
|
<div v-if="contentData.content != ''">
|
||||||
<div class="hyper-link" v-if="conLink.openType == 2">
|
<div class="hyper-link" v-if="conLink.openType == 2">
|
||||||
<div class="hyper-link-row">{{ contentData.contentName }}</div>
|
<div class="hyper-link-row">外链名称: {{ contentData.contentName }}</div>
|
||||||
<div class="hyper-link-row">{{ conLink.url }}</div>
|
<div class="hyper-link-row">外链地址: {{ conLink.url }}</div>
|
||||||
|
<button class="copy-button" @click="copyUrl(conLink.url)">复制外链</button>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="conLink.openType == 1"><iframe :src="conLink.url"
|
<div v-if="conLink.openType == 1"><iframe :src="conLink.url"
|
||||||
style="width: 100%;border:0px;min-height: 473px;" frameborder="0"></iframe></div>
|
style="width: 100%;border:0px;min-height: 473px;" frameborder="0"></iframe></div>
|
||||||
@@ -1683,7 +1684,21 @@
|
|||||||
this.trueFalse = false
|
this.trueFalse = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
copyUrl(currentUrl) {
|
||||||
|
const urlToCopy = currentUrl;
|
||||||
|
|
||||||
|
navigator.clipboard.writeText(urlToCopy)
|
||||||
|
.then(() => {
|
||||||
|
this.$message.success('链接已成功复制到剪贴板');
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
this.$message.error('复制失败,请手动复制:' + urlToCopy);
|
||||||
|
console.error('复制错误:', err);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -2368,4 +2383,16 @@
|
|||||||
height: 200px;
|
height: 200px;
|
||||||
background: url('../../../public/images/couresdetail.png');
|
background: url('../../../public/images/couresdetail.png');
|
||||||
}
|
}
|
||||||
|
.copy-button {
|
||||||
|
background-color: #409EFF;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 8px 12px;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.copy-button:hover {
|
||||||
|
background-color: #66b1ff;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user