mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-04 13:16:44 +00:00
* fix: reload row if the attachments are expired * fix: handle attachment url expiry * fix:build feat: image zoom * fix:attchment comments * fix: async issue
31 lines
646 B
Vue
31 lines
646 B
Vue
<script setup lang="ts">
|
|
interface Props {
|
|
src: string[]
|
|
class?: string
|
|
}
|
|
|
|
const props = defineProps<Props>()
|
|
|
|
const emits = defineEmits(['error'])
|
|
|
|
const currentIndex = ref(0)
|
|
|
|
const handleError = async () => {
|
|
if (currentIndex.value < props.src.length - 1) {
|
|
currentIndex.value = currentIndex.value + 1
|
|
} else {
|
|
const isURLExp = await isURLExpired(props.src[0])
|
|
if (isURLExp.isExpired) {
|
|
emits('error')
|
|
}
|
|
currentIndex.value = 0
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<pdf-object :class="props.class" :url="src[currentIndex]" class="w-full h-full" @error="handleError" />
|
|
</template>
|
|
|
|
<style scoped lang="scss"></style>
|