start
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<script setup lang="ts">
|
||||
import type { DownloadableDocument } from "~/types";
|
||||
|
||||
/**
|
||||
* Блок скачивания документов. Исходная вёрстка раскладывает четыре
|
||||
* ссылки двумя группами по две, поэтому группы формируются здесь.
|
||||
*/
|
||||
const props = defineProps<{ documents: DownloadableDocument[] }>();
|
||||
|
||||
const pairs = computed<DownloadableDocument[][]>(() => {
|
||||
const result: DownloadableDocument[][] = [];
|
||||
for (let i = 0; i < props.documents.length; i += 2) {
|
||||
result.push(props.documents.slice(i, i + 2));
|
||||
}
|
||||
return result;
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="d-flex justify-content-center div-a-img">
|
||||
<div
|
||||
v-for="(pair, index) in pairs"
|
||||
:key="index"
|
||||
class="d-flex justify-content-between"
|
||||
>
|
||||
<a
|
||||
v-for="doc in pair"
|
||||
:key="doc.file"
|
||||
:href="doc.file"
|
||||
download
|
||||
class="download-link"
|
||||
>
|
||||
<img :src="`/assets/ico/${doc.icon}`" :alt="doc.alt" />
|
||||
<span class="text-color" :class="doc.extraClass" v-html="doc.label" />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user