From d7d92f6bab87d9d297c119a06731311e92db9c64 Mon Sep 17 00:00:00 2001 From: Sacha STAFYNIAK Date: Fri, 12 Aug 2022 20:17:50 +0200 Subject: [PATCH 01/10] feat: allow to use render function as message --- README.md | 4 ++++ src/Toaster.vue | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3e538fb..0bddada 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,10 @@ this.$toast.info(`Hey! I'm here`); // Close all opened toast after 3000ms setTimeout(this.$toast.clear, 3000); + +// use render function +// see: https://vuejs.org/api/render-function.html#h +this.$toast.show(() => h('span', `Hey! I'm here`)); ``` ## Available options diff --git a/src/Toaster.vue b/src/Toaster.vue index 30da42c..41ead6b 100644 --- a/src/Toaster.vue +++ b/src/Toaster.vue @@ -10,12 +10,14 @@ @mouseleave="toggleTimer(false)" @click="click" role="alert" - v-html="message" - /> + > + +