feature: implement toast component template

This commit is contained in:
Sagi 2022-09-27 00:10:21 +08:00
parent 38d56ff5f4
commit c5a2f73ae3
1 changed files with 11 additions and 0 deletions

View File

@ -41,6 +41,8 @@ export default defineComponent({
const shouldShowTitle = computed(() => toast.value.title && toast.value.msg);
const shouldShowMessageOnly = computed(() => !toast.value.title && toast.value.msg);
const shouldShowCloseButton = computed(() => {
return true;
});
@ -108,6 +110,15 @@ export default defineComponent({
{shouldShowButtonsInTitle.value && renderNotifyButtons()}
</>
)}
{shouldShowMessageOnly.value &&
(toast.value.buttons ? (
<div class="toast-title-btns-wrapper d-flex">
<h5 class="toast-title modal-tips-title only-toast-msg" v-html={toast.value.msg}></h5>
<div class="after-toast-title text-right ml-auto">{renderNotifyButtons()}</div>
</div>
) : (
<h5 class="toast-title modal-tips-title only-toast-msg" v-html={toast.value.msg}></h5>
))}
</div>
</section>
)}