feat: toast component

This commit is contained in:
Alexandr
2022-07-26 19:13:30 +03:00
parent ba1a458f74
commit 4cca3e63cf
16 changed files with 382 additions and 38 deletions

View File

@@ -1,5 +1,5 @@
<template>
<flowbite-themable-child tag="button" :apply="['background', 'hover', 'focus']" :class="wrapperClasses" :disabled="disabled">
<flowbite-themable-child tag="button" :apply="appliableTheme" :class="wrapperClasses" :disabled="disabled">
<div v-if="!isOutlineGradient && ($slots.prefix || loadingPrefix)" class="mr-2"> <!--automatically add mr class if slot provided or loading -->
<spinner :color="spinnerColor" :size="spinnerSize" v-if="loadingPrefix" />
<slot name="prefix" v-else />
@@ -85,4 +85,9 @@ const loadingSuffix = computed(() => props.loading && props.loadingPosition ===
const { wrapperClasses, spanClasses } = useButtonClasses(toRefs(props))
const { color: spinnerColor, size: spinnerSize } = useButtonSpinner(toRefs(props))
const appliableTheme = computed(() => {
if(['alternative', 'light'].includes(props.color)) return []
return ['background', 'hover', 'focus']
})
</script>