front part

This commit is contained in:
Kseninia Mikhaylova 2024-07-18 14:26:20 +03:00
parent 5466afc08b
commit 424a25ed15
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,22 @@
<script setup lang="ts">
const props = defineProps(['file_id'])
import { apiBase } from '~/helpers';
const headers = new Headers();
headers.append("Content-Type", "application/json");
const file_url_data = await $fetch(`${apiBase}/tgbot/items/get_image/${props.file_id}/`, { headers })
const file_url = file_url_data[0]
const isOpen = ref(false)
const openImage = () => {
isOpen.value = !isOpen.value
}
</script>
<template>
<a href="#">
<Icon name="i-mdi-image" @click="openImage" />
</a>
<UModal v-model="isOpen">
<img :src="file_url" />
</UModal>
</template>

View File

@ -41,6 +41,7 @@ const columns = [
<ul>
<li v-for="el in item.field">
{{ el.field.name }}
<GetImage :file_id="el.id" />
</li>
</ul>
</template>