Skip to content

Commit c31a87c

Browse files
committed
(slots) add system-message
1 parent 468a226 commit c31a87c

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ Example:
761761
| `room-header-info` | Replace the template of the room header text | `room`, `typingUsers`, `userStatus` |
762762
| `room-options` | Replace the template of the room options | - | menu-icon |
763763
| `message` | Replace the template of the message box | `message` | `deleted-icon`, `eye-icon`, `document-icon`, `pencil-icon`, `checkmark-icon`, `dropdown-icon`, `emoji-picker-icon` |
764+
| `system-message` | Replace the template of the system message box | `message` | - |
764765
| `message-failure` | Replace the message failure icon | - | - |
765766
| `messages-empty` | Replace the empty message template | - | - |
766767
| `rooms-empty` | Replace the empty rooms template | - | - |

src/lib/Room/RoomMessage/RoomMessage.vue

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@
99
</div>
1010

1111
<div v-if="message.system" class="vac-card-info vac-card-system">
12-
<format-message
13-
:content="message.content"
14-
:users="roomUsers"
15-
:text-formatting="textFormatting"
16-
:link-options="linkOptions"
17-
@open-user-tag="openUserTag"
18-
>
19-
<template v-for="(i, name) in $scopedSlots" #[name]="data">
20-
<slot :name="name" v-bind="data" />
21-
</template>
22-
</format-message>
12+
<slot name="system-message" v-bind="{ message }">
13+
<format-message
14+
:content="message.content"
15+
:users="roomUsers"
16+
:text-formatting="textFormatting"
17+
:link-options="linkOptions"
18+
@open-user-tag="openUserTag"
19+
>
20+
<template v-for="(i, name) in $scopedSlots" #[name]="data">
21+
<slot :name="name" v-bind="data" />
22+
</template>
23+
</format-message>
24+
</slot>
2325
</div>
2426

2527
<div
@@ -191,9 +193,7 @@
191193
}"
192194
@click="$emit('open-failed-message', { message })"
193195
>
194-
<div class="vac-failure-text">
195-
!
196-
</div>
196+
<div class="vac-failure-text">!</div>
197197
</div>
198198
</slot>
199199
<div

0 commit comments

Comments
 (0)