feat:image preview component add download feature
This commit is contained in:
@@ -59,4 +59,11 @@ export function splitText(text: string): string[] {
|
||||
data.push(t)
|
||||
}
|
||||
return data
|
||||
}
|
||||
|
||||
export function downloadFile(href: string, fileName: string) {
|
||||
const a = document.createElement('a')
|
||||
a.href = href
|
||||
a.download = fileName
|
||||
a.click()
|
||||
}
|
||||
Reference in New Issue
Block a user