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

How Pass html to the toast? i want to show UL/LI menu inside the toast

beshoo opened this issue · comments

commented

How to Pass html to the toast? I want to show UL/LI menu inside the toast.

Use the headless version:

<template>
  <ul>
    <li>Item 1</li>
    <li>Item 2</li>
  </ul>
  <button @click="$emit('closeToast')">Close</button>
</template>
import { toast } from 'vue-sonner'
import MyComponent from './MyComponent.vue'

toast.custom(MyComponent)

Yes just like Wobsoriano said but don't forget about markRaw(MyComponent)

@sadeghbarati this not a nice solution if u just want to "render" html text.
For ex: VueSonner is AWESOME currently is rendered as VueSonenr is AWESOME
I would like to keep using the "types" with the default style.

any update here ?