xiaoluoboding / vue-sonner

🔔 An opinionated toast component for Vue.

Home Page:https://vue-sonner.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add easy feature

pezexd opened this issue · comments

Would be a prop called parseHTML to read descriptions or messages as html.

[types.ts] export interface ToastT { ..., parseHtml: boolean }

[Toast.vue] <template v-if="toast.description"> <template v-if="toast.parseHtml"> <div data-description="" :class="descriptionClass + toastDescriptionClass" v-html="toast.description" /> </template> <template v-else> <div data-description="" :class="descriptionClass + toastDescriptionClass"> {{ toast.description }} </div> </template> </template>

With the new release, you can do it by checking out docs and search for Custom with props