Skip to content

Commit 0298722

Browse files
committed
(slot) add rooms-header named slot
1 parent fea453a commit 0298722

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,12 @@ messageActionHandler({ roomId, action }) {
436436

437437
(5) `replyMessage` object is available when the user replied to another message by clicking the corresponding icon, and contains the message information that was clicked
438438

439+
## Named Slots
440+
441+
| Slot | Action |
442+
| ------------ | ---------------------------------------------------------- |
443+
| rooms-header | Add a template on top of rooms list (above the search bar) |
444+
439445
## Using with Firestore
440446

441447
### Source code

demo/src/ChatContainer.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
@messageActionHandler="messageActionHandler"
6666
@sendMessageReaction="sendMessageReaction"
6767
@typingMessage="typingMessage"
68-
/>
68+
>
69+
</chat-window>
6970
</div>
7071
</template>
7172

src/ChatWindow/ChatWindow.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
@fetchRoom="fetchRoom"
1515
@addRoom="addRoom"
1616
>
17+
<template v-slot:rooms-header>
18+
<slot name="rooms-header"></slot>
19+
</template>
1720
</rooms-list>
21+
1822
<room
1923
:currentUserId="currentUserId"
2024
:rooms="rooms"

src/ChatWindow/RoomsList.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
:class="{ 'rooms-container-full': isMobile }"
55
v-if="showRoomsList"
66
>
7+
<slot name="rooms-header"></slot>
8+
79
<div class="box-search">
810
<div class="icon-search">
911
<svg-icon name="search" />

0 commit comments

Comments
 (0)