Browse Source

feat(nc-gui): AttachmentImage

pull/5046/head
Wing-Kam Wong 2 years ago
parent
commit
59e6cd147d
  1. 24
      packages/nc-gui/components/cell/attachment/Image.vue

24
packages/nc-gui/components/cell/attachment/Image.vue

@ -0,0 +1,24 @@
<script setup lang="ts">
interface Props {
src: string[]
alt?: string
}
const props = defineProps<Props>()
const index = ref(0)
const onError = () => index.value++
</script>
<template>
<LazyNuxtImg
v-if="index < props.src.length"
:src="props.src[index]"
:onerror="onError"
:alt="props?.alt || ''"
placeholder
quality="75"
/>
<img v-else src="~/assets/img/file-not-found.png" />
</template>
Loading…
Cancel
Save