vome-core 0.0.46 → 0.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
v-else
|
|
70
70
|
type="button"
|
|
71
71
|
title="下载"
|
|
72
|
-
:disabled="downloading"
|
|
73
72
|
@click.stop="downloadFile"
|
|
74
73
|
>
|
|
75
74
|
<i class="ri-download-2-line" />
|
|
@@ -104,8 +103,6 @@ const props = withDefaults(
|
|
|
104
103
|
item: UploadItem
|
|
105
104
|
disabled?: boolean
|
|
106
105
|
showTag?: boolean
|
|
107
|
-
/** 私有桶等场景:先解析可访问 URL(如短时签名链)再下载 */
|
|
108
|
-
resolveDownloadUrl?: (url: string, item: UploadItem) => Promise<string | undefined>
|
|
109
106
|
}>(),
|
|
110
107
|
{
|
|
111
108
|
disabled: false,
|
|
@@ -117,7 +114,6 @@ const emit = defineEmits<{ remove: [] }>()
|
|
|
117
114
|
|
|
118
115
|
const previewOpen = ref(false)
|
|
119
116
|
const imgBroken = ref(false)
|
|
120
|
-
const downloading = ref(false)
|
|
121
117
|
|
|
122
118
|
const previewSrc = computed(() => props.item.preload || props.item.url || '')
|
|
123
119
|
|
|
@@ -137,33 +133,20 @@ const canInlinePreview = computed(() => {
|
|
|
137
133
|
return INLINE_KINDS.has(kind)
|
|
138
134
|
})
|
|
139
135
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
String(url).split('?')[0]?.split('/').pop() ||
|
|
155
|
-
'download'
|
|
156
|
-
const a = document.createElement('a')
|
|
157
|
-
a.href = url
|
|
158
|
-
a.download = base
|
|
159
|
-
a.rel = 'noopener'
|
|
160
|
-
a.target = '_blank'
|
|
161
|
-
document.body.appendChild(a)
|
|
162
|
-
a.click()
|
|
163
|
-
a.remove()
|
|
164
|
-
} finally {
|
|
165
|
-
downloading.value = false
|
|
166
|
-
}
|
|
136
|
+
function downloadFile() {
|
|
137
|
+
const url = previewSrc.value
|
|
138
|
+
if (!url) return
|
|
139
|
+
const base =
|
|
140
|
+
props.item.name ||
|
|
141
|
+
String(url).split('?')[0]?.split('/').pop() ||
|
|
142
|
+
'download'
|
|
143
|
+
const a = document.createElement('a')
|
|
144
|
+
a.href = url
|
|
145
|
+
a.download = base
|
|
146
|
+
a.rel = 'noopener'
|
|
147
|
+
document.body.appendChild(a)
|
|
148
|
+
a.click()
|
|
149
|
+
a.remove()
|
|
167
150
|
}
|
|
168
151
|
|
|
169
152
|
/** 仅上传中显示;失败后隐藏,避免挡住预览/删除 */
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
:item="item"
|
|
39
39
|
:disabled="disabled"
|
|
40
40
|
:show-tag="showTag"
|
|
41
|
-
:resolve-download-url="resolveDownloadUrl"
|
|
42
41
|
@remove="remove(index)"
|
|
43
42
|
/>
|
|
44
43
|
</div>
|
|
@@ -97,8 +96,6 @@ const props = withDefaults(
|
|
|
97
96
|
drag?: boolean
|
|
98
97
|
prefixPath?: string
|
|
99
98
|
beforeUpload?: (file: File) => boolean | Promise<boolean>
|
|
100
|
-
/** 私有桶等:下载前解析可访问 URL(短时签名链) */
|
|
101
|
-
resolveDownloadUrl?: (url: string, item: UploadItem) => Promise<string | undefined>
|
|
102
99
|
}>(),
|
|
103
100
|
{
|
|
104
101
|
modelValue: '',
|
package/dist/index.js
CHANGED
|
@@ -27856,7 +27856,7 @@ init_excel();
|
|
|
27856
27856
|
// package.json
|
|
27857
27857
|
var package_default = {
|
|
27858
27858
|
name: "vome-core",
|
|
27859
|
-
version: "0.0.
|
|
27859
|
+
version: "0.0.47",
|
|
27860
27860
|
description: "Vome framework \u2014 shared + Bun/Elysia server + Vue admin",
|
|
27861
27861
|
license: "MIT",
|
|
27862
27862
|
type: "module",
|
package/dist/server/index.js
CHANGED
|
@@ -31168,7 +31168,7 @@ init_excel();
|
|
|
31168
31168
|
// package.json
|
|
31169
31169
|
var package_default = {
|
|
31170
31170
|
name: "vome-core",
|
|
31171
|
-
version: "0.0.
|
|
31171
|
+
version: "0.0.47",
|
|
31172
31172
|
description: "Vome framework \u2014 shared + Bun/Elysia server + Vue admin",
|
|
31173
31173
|
license: "MIT",
|
|
31174
31174
|
type: "module",
|