多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
646 B

4 months ago
<script setup lang="ts">
interface Props {
src: string[]
class?: string
4 months ago
}
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
}
}
4 months ago
</script>
<template>
<pdf-object :class="props.class" :url="src[currentIndex]" class="w-full h-full" @error="handleError" />
4 months ago
</template>
<style scoped lang="scss"></style>