fix: 点击无响应

This commit is contained in:
2023-07-23 01:43:29 +08:00
parent 16663000f1
commit 40f4449070
3 changed files with 7 additions and 4 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-22 14:15:32
* @LastEditTime: 2023-07-23 01:34:25
* @FilePath: \vue3\packages\download-link\index.vue
* @Description: 现在组件
*
@ -48,12 +48,12 @@ async function reload(id: string | number) {
const res = await props.request(id)
url = res.url
fileName = res.name
type = 'primary'
}
catch (error) {
type = 'danger'
}
finally {
type = 'success'
loading = false
}
}
@ -88,6 +88,8 @@ function init() {
watch(() => props.src, init)
tryOnMounted(init)
tryOnUnmounted(() => {
if (url.startsWith('blob:')) {
// revoke object URL after use to avoid memory leak.