start
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
import type { SpecialtyTable } from "~/types";
|
||||
|
||||
/**
|
||||
* Таблица специальностей учебного заведения.
|
||||
* Ячейки поддерживают объединение по вертикали (rowspan), а переводы
|
||||
* строк в тексте ЕГЭ отображаются переносом, как в исходной вёрстке.
|
||||
*/
|
||||
defineProps<{ table: SpecialtyTable }>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<p v-if="table.caption" v-html="table.caption" />
|
||||
<div class="table-responsive rounded">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-for="column in table.columns" :key="column">{{ column }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(row, rowIndex) in table.rows" :key="rowIndex">
|
||||
<td
|
||||
v-for="(cell, cellIndex) in row.cells"
|
||||
:key="cellIndex"
|
||||
:rowspan="cell.rowspan"
|
||||
v-html="nl2br(cell.text)"
|
||||
/>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user