evo-mark / vue3-snackbar

Snackbar service for Vue3 applications
MIT License
49 stars 3 forks source link

Documentation for slots #5

Closed pimboden closed 1 year ago

pimboden commented 1 year ago

I needed to display HTML, and not basic text in the snackbar. I manage to do with the slots, after checking the sourcecode.

<vue3-snackbar bottom right :duration="4000">
   <template #message-content="contentProps">
        <div class="vue3-snackbar-message-title" v-html="contentProps.message.title || contentProps.message.text">
    </div>
    <div v-if="contentProps.message.title && contentProps.message.text" class="vue3-snackbar-message-additional" v-html="contentProps.message.text">
     </div>
   </template>
</vue3-snackbar>

This slot-feature should belong in the documentation.

This snackbar is great and eay to use. Thanks

craigrileyuk commented 1 year ago

I'll shortly be rewriting the documentation for this project and moving it to a new domain (rather than Github pages).

Will definitely add the slots stuff in. To be honest, I added it for one of my own projects recently and then completely forgot about it.

Glad the package is helping you!