Использование
Пропс items — массив объектов, который задаёт содержимое DescriptionList:
label?: stringdescription?: stringicon?: IconComponentavatar?: AvatarPropsactions?: ButtonProps[]orientation?: "horizontal" | "vertical"slot?: stringclass?: anyb24ui?: { labelWrapper?: ClassNameValue, icon?: ClassNameValue, avatar?: ClassNameValue, label?: ClassNameValue, descriptionWrapper?: ClassNameValue, description?: ClassNameValue, actions?: ClassNameValue }
- Полное имя
- Michael Foster
- Событие
- Оплата проходит через Atol Online
<script setup lang="ts">
import type { DescriptionListItem } from '@bxshefby/b24ui-nuxt'
const items = ref<DescriptionListItem[]>([
{
label: 'Полное имя',
description: 'Michael Foster'
},
{
label: 'Событие',
description: 'Оплата проходит через Atol Online'
}
])
</script>
<template>
<B24DescriptionList :items="items" />
</template>
<script setup lang="ts">
import { ref } from 'vue'
import type { DescriptionListItem } from '@bxshefby/b24ui-nuxt'
const items = ref<DescriptionListItem[]>([
{
label: 'Полное имя',
description: 'Michael Foster'
},
{
label: 'Событие',
description: 'Оплата проходит через Atol Online'
}
])
</script>
<template>
<B24DescriptionList :items="items" />
</template>
Легенда
Пропс legend задаёт легенду DescriptionList.
Данные заявителя
- Полное имя
- Michael Foster
- Событие
- Оплата проходит через Atol Online
<script setup lang="ts">
import type { DescriptionListItem } from '@bxshefby/b24ui-nuxt'
const items = ref<DescriptionListItem[]>([
{
label: 'Полное имя',
description: 'Michael Foster'
},
{
label: 'Событие',
description: 'Оплата проходит через Atol Online'
}
])
</script>
<template>
<B24DescriptionList legend="Данные заявителя" :items="items" />
</template>
<script setup lang="ts">
import { ref } from 'vue'
import type { DescriptionListItem } from '@bxshefby/b24ui-nuxt'
const items = ref<DescriptionListItem[]>([
{
label: 'Полное имя',
description: 'Michael Foster'
},
{
label: 'Событие',
description: 'Оплата проходит через Atol Online'
}
])
</script>
<template>
<B24DescriptionList legend="Данные заявителя" :items="items" />
</template>
Текст
Пропс text задаёт описание DescriptionList.
Данные заявителя
Личные данные и заявка.
- Полное имя
- Michael Foster
- Событие
- Оплата проходит через Atol Online
<script setup lang="ts">
import type { DescriptionListItem } from '@bxshefby/b24ui-nuxt'
const items = ref<DescriptionListItem[]>([
{
label: 'Полное имя',
description: 'Michael Foster'
},
{
label: 'Событие',
description: 'Оплата проходит через Atol Online'
}
])
</script>
<template>
<B24DescriptionList legend="Данные заявителя" text="Личные данные и заявка." :items="items" />
</template>
<script setup lang="ts">
import { ref } from 'vue'
import type { DescriptionListItem } from '@bxshefby/b24ui-nuxt'
const items = ref<DescriptionListItem[]>([
{
label: 'Полное имя',
description: 'Michael Foster'
},
{
label: 'Событие',
description: 'Оплата проходит через Atol Online'
}
])
</script>
<template>
<B24DescriptionList legend="Данные заявителя" text="Личные данные и заявка." :items="items" />
</template>
Ключ подписи
Свойство объекта, из которого берётся подпись, меняет пропс label-key. По умолчанию label.
Данные заявителя
Личные данные и заявка.
- Полное имя
- Michael Foster
- Событие
- Оплата проходит через Atol Online
<script setup lang="ts">
import type { DescriptionListItem } from '@bxshefby/b24ui-nuxt'
const items = ref<DescriptionListItem[]>([
{
title: 'Полное имя',
description: 'Michael Foster'
},
{
title: 'Событие',
description: 'Оплата проходит через Atol Online'
}
])
</script>
<template>
<B24DescriptionList
legend="Данные заявителя"
text="Личные данные и заявка."
label-key="title"
:items="items"
/>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import type { DescriptionListItem } from '@bxshefby/b24ui-nuxt'
const items = ref<DescriptionListItem[]>([
{
title: 'Полное имя',
description: 'Michael Foster'
},
{
title: 'Событие',
description: 'Оплата проходит через Atol Online'
}
])
</script>
<template>
<B24DescriptionList
legend="Данные заявителя"
text="Личные данные и заявка."
label-key="title"
:items="items"
/>
</template>
Ключ описания
Свойство объекта, из которого берётся описание, меняет пропс description-key. По умолчанию description.
Данные заявителя
Личные данные и заявка.
- Полное имя
- Michael Foster
- Событие
- Оплата проходит через Atol Online
<script setup lang="ts">
import type { DescriptionListItem } from '@bxshefby/b24ui-nuxt'
const items = ref<DescriptionListItem[]>([
{
title: 'Полное имя',
info: 'Michael Foster'
},
{
title: 'Событие',
info: 'Оплата проходит через Atol Online'
}
])
</script>
<template>
<B24DescriptionList
legend="Данные заявителя"
text="Личные данные и заявка."
label-key="title"
description-key="info"
:items="items"
/>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import type { DescriptionListItem } from '@bxshefby/b24ui-nuxt'
const items = ref<DescriptionListItem[]>([
{
title: 'Полное имя',
info: 'Michael Foster'
},
{
title: 'Событие',
info: 'Оплата проходит через Atol Online'
}
])
</script>
<template>
<B24DescriptionList
legend="Данные заявителя"
text="Личные данные и заявка."
label-key="title"
description-key="info"
:items="items"
/>
</template>
Размер
Пропс size меняет размер DescriptionList.
Данные заявителя
Личные данные и заявка.
- Полное имя
- Michael Foster
- Событие
- Оплата проходит через Atol Online
<script setup lang="ts">
import type { DescriptionListItem } from '@bxshefby/b24ui-nuxt'
const items = ref<DescriptionListItem[]>([
{
label: 'Полное имя',
description: 'Michael Foster'
},
{
label: 'Событие',
description: 'Оплата проходит через Atol Online'
}
])
</script>
<template>
<B24DescriptionList
size="sm"
legend="Данные заявителя"
text="Личные данные и заявка."
:items="items"
/>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import type { DescriptionListItem } from '@bxshefby/b24ui-nuxt'
const items = ref<DescriptionListItem[]>([
{
label: 'Полное имя',
description: 'Michael Foster'
},
{
label: 'Событие',
description: 'Оплата проходит через Atol Online'
}
])
</script>
<template>
<B24DescriptionList
size="sm"
legend="Данные заявителя"
text="Личные данные и заявка."
:items="items"
/>
</template>
Примеры
С иконками в элементах
Свойство icon показывает иконку внутри элементов.
Информация о кандидате
Личные данные и заявка.
- Строка 1.1
- Описание 1.1
- Строка 1.2
- Описание 1.2
- Описание 1.3
С аватарами в элементах
Свойство avatar показывает аватар внутри элементов.
Информация о кандидате
Личные данные и заявка.
Строка 1.1- Описание 1.1
Строка 1.2- Описание 1.2

- Описание 1.3
С действиями в элементах
Свойство actions добавляет к элементам DescriptionList кнопки Button.
Свойство orientation меняет ориентацию действий элементов.
Информация о кандидате
Личные данные и заявка.
- Строка 1.1
- Описание 1.1
- Строка 1.2
- Описание 1.2
- Строка 1.3
- Описание 1.3
- Длинное описание строки: оно показывает, как текст переносится внутри списка описаний и остаётся читаемым, даже когда занимает несколько строк подряд.
Свой слот
Свойство slot настраивает отдельный элемент.
Вам будут доступны слоты:
#{{ item.slot }}
Информация о кандидате
Личные данные и заявка.
Сумма
- $10,560.00Оплачено
- Клиент
- Имя сотрудника
- Срок
- Способ оплаты
- Оплачено через MasterCard
Ссылка в описании
Слот description получает элемент, поэтому описание можно отрисовать как
Link без дополнительного свойства у элемента. Слот
общий, а не отдельный для каждого элемента, поэтому ветка по умолчанию
оставляет остальные элементы обычным текстом.
- Документация
- Руководство по началу работы
- Сайт продукта
- Открыть на bitrix24.com
- Создано
- 6 октября 2024 08:37
API
Пропсы
Слоты
Тема
export default {
slots: {
root: 'w-full shrink-0',
legend: 'font-(--ui-font-weight-semi-bold) text-label',
text: 'text-description',
container: 'grid grid-cols-1 sm:grid-cols-[min(50%,theme(spacing.80))_auto]',
labelWrapper: 'col-start-1 border-t first:border-none sm:border-t flex flex-nowrap flex-row items-center justify-start gap-1.5 border-(--ui-color-divider-vibrant-default) sm:border-(--ui-color-divider-vibrant-default) text-description',
icon: 'shrink-0 size-6 text-description',
avatar: 'shrink-0',
avatarSize: '',
label: '',
descriptionWrapper: 'sm:border-t sm:[&:nth-child(2)]:border-none sm:border-(--ui-color-divider-vibrant-default) text-label',
description: '',
actions: 'flex flex-wrap gap-1.5 shrink-0',
footer: 'border-t border-(--ui-color-divider-vibrant-default)'
},
variants: {
size: {
sm: {
legend: 'text-md',
text: 'mt-1 max-w-2/3 text-(length:--ui-font-size-sm)',
container: 'mt-2.5 text-md',
labelWrapper: 'pt-3 sm:py-3',
avatarSize: 'xs',
label: '',
descriptionWrapper: 'pb-3 pt-1 sm:py-3',
description: '',
footer: 'mt-2 p-2'
},
md: {
legend: 'text-xl',
text: 'mt-2 max-w-2/3 text-(length:--ui-font-size-lg) leading-5',
container: 'mt-3 text-(length:--ui-font-size-lg)',
labelWrapper: 'pt-3 sm:py-3',
avatarSize: 'xs',
label: '',
descriptionWrapper: 'pb-3 pt-1 sm:py-3',
description: '',
footer: 'mt-4 p-4'
}
},
orientation: {
horizontal: {
descriptionWrapper: 'w-full flex flex-row items-center justify-between gap-4',
actions: 'items-center'
},
vertical: {
descriptionWrapper: '',
actions: 'items-start mt-2.5'
}
},
title: {
true: {
description: 'mt-1'
}
}
},
defaultVariants: {
size: 'md'
}
}