Skip to content

Commit 09bcea9

Browse files
refactor: revert support for slots in vue-3
1 parent a4032ba commit 09bcea9

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/components/Toast.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@
1313
ref="progressBar"
1414
></toast-progress>
1515
<div v-if="data.title" class="toast-title" v-html="data.title"></div>
16-
<div v-if="data.msg" class="toast-message" v-html="data.msg"></div>
16+
<div
17+
v-if="data.msg && !$slots.default"
18+
class="toast-message"
19+
v-html="data.msg"
20+
></div>
21+
<div v-if="$slots.default" class="toast-message">
22+
<slot />
23+
</div>
1724
</div>
1825
</template>
1926
<script lang="ts">

src/components/ToastContainer.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
:key="position"
66
>
77
<Toast :data="toast" v-for="toast in toasts" :key="toast.index">
8+
<slot />
89
</Toast>
910
</div>
1011
</template>

0 commit comments

Comments
 (0)