feat: add download button for manual knowledge in doc-content
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -627,7 +627,8 @@ const downloadFile = () => {
|
|||||||
const link = document.createElement("a");
|
const link = document.createElement("a");
|
||||||
link.style.display = "none";
|
link.style.display = "none";
|
||||||
link.setAttribute("href", url.value);
|
link.setAttribute("href", url.value);
|
||||||
link.setAttribute("download", props.details.title);
|
link.setAttribute("download", props.details.type === 'manual' ? props.details.title + '.md' : props.details.title);
|
||||||
|
document.body.appendChild(link);
|
||||||
link.click();
|
link.click();
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
document.body.removeChild(link);
|
document.body.removeChild(link);
|
||||||
@@ -697,6 +698,9 @@ const handleDetailsScroll = () => {
|
|||||||
<div class="manual_title_box">
|
<div class="manual_title_box">
|
||||||
<span class="manual_title">{{ details.title }}</span>
|
<span class="manual_title">{{ details.title }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="icon_box" @click="downloadFile()">
|
||||||
|
<img class="download_box" src="@/assets/img/download.svg" alt="">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content_header">
|
<div class="content_header">
|
||||||
|
|||||||
Reference in New Issue
Block a user