mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[comp] add YunoAlert component
This commit is contained in:
parent
1007c1ee57
commit
09df53adab
1 changed files with 35 additions and 0 deletions
35
app/src/components/globals/YunoAlert.vue
Normal file
35
app/src/components/globals/YunoAlert.vue
Normal file
|
@ -0,0 +1,35 @@
|
|||
<template>
|
||||
<component
|
||||
v-bind="$attrs"
|
||||
:is="alert ? 'b-alert' : 'div'"
|
||||
:variant="alert ? variant : null"
|
||||
:class="{ ['alert alert-' + variant]: !alert }"
|
||||
class="d-flex flex-column flex-md-row align-items-center"
|
||||
>
|
||||
<icon :iname="_icon" class="mr-md-3 mb-md-0 mb-2" :variant="variant" />
|
||||
|
||||
<div class="w-100">
|
||||
<slot name="default" />
|
||||
</div>
|
||||
</component>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { DEFAULT_STATUS_ICON } from '@/helpers/yunohostArguments'
|
||||
|
||||
export default {
|
||||
name: 'YunoAlert',
|
||||
|
||||
props: {
|
||||
alert: { type: Boolean, default: false },
|
||||
variant: { type: String, default: 'info' },
|
||||
icon: { type: String, default: null }
|
||||
},
|
||||
|
||||
computed: {
|
||||
_icon () {
|
||||
return DEFAULT_STATUS_ICON[this.variant]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Reference in a new issue