1
0

feat: add extra prop for message center text

This commit is contained in:
kolaente
2021-12-12 20:34:26 +01:00
committed by Dominik Pschenitschni
parent a1814ea29d
commit 1fc1c20c87
2 changed files with 21 additions and 3 deletions

View File

@ -1,18 +1,36 @@
<template>
<div class="message-wrapper">
<div class="message" :class="variant">
<div class="message" :class="[variant, textAlignClass]">
<slot/>
</div>
</div>
</template>
<script lang="ts" setup>
defineProps({
import {computed} from 'vue'
const props = defineProps({
variant: {
type: String,
default: 'info',
},
textAlign: {
type: String,
default: 'left',
},
})
const textAlignClass = computed(() => {
switch (props.textAlign) {
case 'left':
return ''
case 'right':
return 'has-text-right'
case 'center':
return 'has-text-centered'
}
})
</script>
<style lang="scss" scoped>