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(notification-list): added a slot for when there are no notifications #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions @uportal/notification-list/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,11 @@ bg = background
--notif-list-item-dd-height: 28px; /* size of ellipsis-v icon trigger for dropdown */
}
```

### Slots

`<notification-list>` has the following slots:

* `header`
* `empty`: displayed when there are no notifications to list
* `footer`
3 changes: 3 additions & 0 deletions @uportal/notification-list/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<template v-slot:header>
<h2>Recent Updates</h2>
</template>
<template v-slot:empty>
You have no notifications at this time.
</template>
</notification-list>
</div>
</main>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
:color-map="colors"
>
</notification-item>
<span v-if="loaded && !notifications.length">No results found.</span>
<span v-if="loaded && !notifications.length">
<slot name="empty">No results found.</slot>
</span>
</div>
<div class="notification-list-footer notification-list-section">
<slot name="footer"></slot>
Expand Down