fix: 点击无响应
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user