mirror of
https://github.com/elk-zone/elk.git
synced 2024-09-06 20:29:08 +01:00
feat: add remote url to image srcset in case original is down
This commit is contained in:
parent
7760d03f9d
commit
8537c8ee54
1 changed files with 1 additions and 0 deletions
|
@ -10,6 +10,7 @@ const { attachment } = defineProps<{
|
||||||
const src = $computed(() => attachment.previewUrl || attachment.url || attachment.remoteUrl!)
|
const src = $computed(() => attachment.previewUrl || attachment.url || attachment.remoteUrl!)
|
||||||
const srcset = $computed(() => [
|
const srcset = $computed(() => [
|
||||||
[attachment.url, attachment.meta?.original?.width],
|
[attachment.url, attachment.meta?.original?.width],
|
||||||
|
[attachment.remoteUrl, attachment.meta?.original?.width],
|
||||||
[attachment.previewUrl, attachment.meta?.small?.width],
|
[attachment.previewUrl, attachment.meta?.small?.width],
|
||||||
].filter(([url]) => url).map(([url, size]) => `${url} ${size}w`).join(', '))
|
].filter(([url]) => url).map(([url, size]) => `${url} ${size}w`).join(', '))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue