Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(NcListItem): add title slot #5388

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/components/NcListItem/NcListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<template #icon>
<NcAvatar disable-menu :size="44" user="janedoe" display-name="Jane Doe" />
</template>
<template #name>
<span style="display: flex; color: var(--color-primary);">
Name of the element with content
</span>
</template>
<template #subname>
In this slot you can put both text and other components such as icons
</template>
Expand Down Expand Up @@ -193,6 +198,14 @@
<template #icon>
<NcAvatar disable-menu :size="44" user="janedoe" display-name="Jane Doe" />
</template>
<template #name>
<span style="display: flex; gap: 0.5rem; color: var(--color-primary);">
Flexible styling within the first line of the component
<div style="color: var(--color-secondary);">
like this.
</div>
</span>
</template>
<template #subname>
In this slot you can put both text and other components such as icons
</template>
Expand Down Expand Up @@ -386,7 +399,8 @@
<div class="list-item-content">
<div class="list-item-content__main">
<div class="list-item-content__name">
{{ name }}
<!-- @slot Slot for the first line of the component. prop 'name' is used as a fallback is no slots are provided -->
<slot name="name">{{ name }}</slot>
</div>
<div v-if="hasSubname"
class="list-item-content__subname"
Expand Down