Skip to content

downloadFile下载文件

下载文件到本地并自定义文件名

基本使用


vue
<script setup lang="ts">
import { downloadFile } from 'vue-jwhuang-ui'

downloadFile('https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg', 'xiaoniao')
</script>

Params

参数说明类型默认值
url文件的 URLstringundefined
fileName?文件的命名,如果未提供,则从 URL 中尝试提取stringundefined