Skip to content

Commit

Permalink
feat(banner): allow also placement at bottom of page
Browse files Browse the repository at this point in the history
  • Loading branch information
stfsy committed Sep 18, 2022
1 parent 4e06c78 commit 801d1d1
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/components/banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const props = defineProps({
parent: {
type: String
},
bottom: {
type: Boolean,
default: false
},
closeButtonTitle: {
type: String,
default: 'Close'
Expand All @@ -47,12 +51,19 @@ const showBanner = computed(() => {
})
const clazz = computed(() => {
const clazz = 'top-0 h-14 pl-2 pr-12 w-full bg-lime-300 flex items-center justify-center font-medium shadow' + ' '
let clazz = 'h-14 pl-2 pr-12 w-full bg-lime-300 flex items-center justify-center font-medium shadow' + ' '
if (props.bottom) {
clazz += 'bottom-0 '
} else {
clazz += 'top-0 '
}
if (props.parent) {
return clazz + 'fixed z-50'
clazz += 'fixed z-50'
} else {
return clazz + 'absolute z-10'
clazz += 'absolute z-10'
}
return clazz
})
const closeBanner = () => {
Expand Down

0 comments on commit 801d1d1

Please sign in to comment.