|
|
@ -168,6 +168,22 @@ watch(view, async (nextView) => { |
|
|
|
await loadGalleryData() |
|
|
|
await loadGalleryData() |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { appInfo } = useGlobal() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getImgSrc = (item: Record<string, any>) => { |
|
|
|
|
|
|
|
if (item.data) { |
|
|
|
|
|
|
|
return item.data |
|
|
|
|
|
|
|
} else if (item.path) { |
|
|
|
|
|
|
|
return `${appInfo.value.ncSiteUrl}/${item.path}` |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return item.url |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const showFallback = (evt: any, item: Record<string, any>) => { |
|
|
|
|
|
|
|
evt.onerror = null |
|
|
|
|
|
|
|
evt.target.src = item.url |
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
@ -205,7 +221,8 @@ watch(view, async (nextView) => { |
|
|
|
quality="90" |
|
|
|
quality="90" |
|
|
|
placeholder |
|
|
|
placeholder |
|
|
|
class="h-52 object-contain" |
|
|
|
class="h-52 object-contain" |
|
|
|
:src="attachment.url" |
|
|
|
:src="getImgSrc(attachment)" |
|
|
|
|
|
|
|
:onerror="(e) => showFallback(e, attachment)" |
|
|
|
/> |
|
|
|
/> |
|
|
|
</a-carousel> |
|
|
|
</a-carousel> |
|
|
|
|
|
|
|
|
|
|
|