11<template >
2- <b-card >
3- <!-- TODO add possible blank Img? -->
4- <!-- Problem is BCard doesn't have an option for blank imgs -->
2+ <b-card :img-bottom =" imgBottomBoolean" >
3+ <template v-if =" ! noImgBoolean " #img >
4+ <slot name =" img" >
5+ <b-card-img v-bind =" imgAttrs" />
6+ </slot >
7+ </template >
8+
59 <template v-if =" ! noHeaderBoolean " #header >
610 <slot name =" header" >
711 <b-placeholder v-bind =" headerAttrs" />
2630
2731<script setup lang="ts">
2832import BCard from ' ../BCard/BCard.vue'
33+ import BCardImg from ' ../BCard/BCardImg.vue'
2934import BPlaceholder from ' ./BPlaceholder.vue'
3035import {Booleanish , ColorVariant } from ' ../../types'
3136import {computed , toRef } from ' vue'
@@ -37,17 +42,20 @@ interface Props {
3742 headerVariant? : ColorVariant
3843 headerAnimation? : ' glow' | ' wave'
3944 headerSize? : ' xs' | ' sm' | ' lg'
40-
4145 noFooter? : Booleanish
4246 footerWidth? : string | number
4347 footerVariant? : ColorVariant
4448 footerAnimation? : ' glow' | ' wave'
4549 footerSize? : ' xs' | ' sm' | ' lg'
46-
4750 animation? : ' glow' | ' wave'
4851 size? : ' xs' | ' sm' | ' lg'
4952 variant? : ColorVariant
5053 noButton? : Booleanish
54+ imgBottom? : Booleanish
55+ imgSrc? : string
56+ imgBlankColor? : string
57+ imgHeight? : string | number
58+ noImg? : Booleanish
5159}
5260
5361const props = withDefaults (defineProps <Props >(), {
@@ -56,11 +64,17 @@ const props = withDefaults(defineProps<Props>(), {
5664 footerWidth: 100 ,
5765 noHeader: false ,
5866 noFooter: false ,
67+ imgBlankColor: ' #868e96' ,
68+ imgHeight: 100 ,
69+ imgBottom: false ,
70+ noImg: false ,
5971})
6072
6173const noButtonBoolean = useBooleanish (toRef (props , ' noButton' ))
6274const noHeaderBoolean = useBooleanish (toRef (props , ' noHeader' ))
6375const noFooterBoolean = useBooleanish (toRef (props , ' noFooter' ))
76+ const noImgBoolean = useBooleanish (toRef (props , ' noImg' ))
77+ const imgBottomBoolean = useBooleanish (toRef (props , ' imgBottom' ))
6478
6579const headerAttrs = computed (() => ({
6680 width: props .headerWidth ,
@@ -83,4 +97,13 @@ const footerAttrs = computed(() => ({
8397 size: props .footerSize ,
8498 variant: props .footerVariant ,
8599}))
100+
101+ const imgAttrs = computed (() => ({
102+ blank: ! props .imgSrc ? true : false ,
103+ blankColor: props .imgBlankColor ,
104+ height: ! props .imgSrc ? props .imgHeight : undefined ,
105+ src: props .imgSrc ,
106+ top: ! imgBottomBoolean .value ,
107+ bottom: imgBottomBoolean .value ,
108+ }))
86109 </script >
0 commit comments