fix: 下载组件

This commit is contained in:
2023-07-21 03:58:45 +08:00
parent 22a3951222
commit 735170b897
7 changed files with 315 additions and 62 deletions

View File

@ -2,7 +2,7 @@
* @Author: zhaojinfeng 121016171@qq.com
* @Date: 2023-07-21 01:21:34
* @LastEditors: zhaojinfeng 121016171@qq.com
* @LastEditTime: 2023-07-21 01:51:17
* @LastEditTime: 2023-07-21 03:57:13
* @FilePath: \vue3\packages\download-link\index.vue
* @Description: 现在组件
*
@ -79,8 +79,11 @@ function download() {
downloadByRequest(props.src)
break
case 'object':
if (typeof props.src?.url === 'string')
downloadByRequest(props.src.url)
if (typeof props.src?.url === 'string') {
url = props.src.url
type = 'success'
saveAs(props.src.url, props.src.name)
}
break
default:
break