Skip to content

Commit f66d2e8

Browse files
committed
优化
1 parent 00468cd commit f66d2e8

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/modules/upload/components/items/viewer.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const img = reactive({
2727
});
2828
2929
function open(item: Eps.SpaceInfoEntity, list: Eps.SpaceInfoEntity[]) {
30-
if (item.type) {
30+
if (item?.type) {
3131
if (item.type == "image") {
3232
img.visible = true;
3333
img.urls = list.filter((e) => e.type == "image").map((e) => e.url || "");

src/modules/upload/components/upload.vue

+1-8
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,7 @@ function clear() {
351351
352352
// 预览
353353
function preview(item: Upload.Item) {
354-
if (item.type == "image") {
355-
refs.viewer?.open(
356-
item.preload,
357-
list.value.map((e) => e.preload)
358-
);
359-
} else {
360-
window.open(item.url);
361-
}
354+
refs.viewer?.open(item, list.value);
362355
}
363356
364357
// 文件上传请求

0 commit comments

Comments
 (0)