-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
- 菜单新增 tag 显示,支持 4 中类型颜色及 dot 圆点显示 | ||
- 新增菜单及顶栏颜色选择配色 | ||
- 增加示例结果页 | ||
- 新增文件下载示例 | ||
|
||
### ⚡ Wip | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<template> | ||
<div class="m-5 demo-box"> | ||
<a-alert message="根据后台接口文件流下载" /> | ||
<a-button type="primary" class="my-4" @click="handleDownByData"> 文件流下载 </a-button> | ||
|
||
<a-alert message="根据文件地址下载文件" /> | ||
|
||
<a-button type="primary" class="my-4" @click="handleDownloadByUrl"> 文件地址下载 </a-button> | ||
</div> | ||
</template> | ||
<script lang="ts"> | ||
import { defineComponent } from 'vue'; | ||
import { downloadByUrl, downloadByData } from '/@/utils/file/FileDownload'; | ||
export default defineComponent({ | ||
setup() { | ||
function handleDownByData() { | ||
downloadByData('text content', 'testName.txt'); | ||
} | ||
function handleDownloadByUrl() { | ||
downloadByUrl({ | ||
url: 'https://codeload.github.com/anncwb/vue-vben-admin-doc/zip/master', | ||
target: '_self', | ||
}); | ||
} | ||
return { | ||
handleDownloadByUrl, | ||
handleDownByData, | ||
}; | ||
}, | ||
}); | ||
</script> |