1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| /**
| * 下载文件
| * @param data
| * @param fileName
| */
| export function downloadFile (data: Blob, fileName: string) {
| const lable = document.createElement('a')
| lable.href = window.URL.createObjectURL(data)
| lable.download = fileName
| lable.click()
| URL.revokeObjectURL(lable.href)
| }
|
| export const requireImg = (imgPath: string) => {
| return new URL(`../assets/${imgPath}`, import.meta.url).href
| }
|
|