mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-06-20 11:47:53 +02:00
Add Notification vue component
This commit is contained in:
parent
5290f9f57c
commit
b40fc65120
@ -4,8 +4,8 @@
|
|||||||
<h1 class="title" v-html="title" v-if="title"></h1>
|
<h1 class="title" v-html="title" v-if="title"></h1>
|
||||||
<slot />
|
<slot />
|
||||||
<p v-if="showTag">
|
<p v-if="showTag">
|
||||||
<div class="notification is-danger" v-if="fail" v-html="fail" />
|
<notification :message="fail" type="is-danger" v-if="fail" />
|
||||||
<div class="notification is-success" v-if="success" v-html="success" />
|
<notification :message="success" type="is-success" v-if="success" />
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
45
resources/js/components/Notification.vue
Normal file
45
resources/js/components/Notification.vue
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<template>
|
||||||
|
<div class="notification" :class="type" v-if="show">
|
||||||
|
<button class="delete" v-if="isDeletable" @click="close"></button>
|
||||||
|
{{ message }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'Notification',
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
show: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
props: {
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
default: 'is-primary'
|
||||||
|
},
|
||||||
|
|
||||||
|
message: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
|
||||||
|
isDeletable: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
close (event) {
|
||||||
|
if (event) {
|
||||||
|
this.show = false
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
2
resources/js/components/index.js
vendored
2
resources/js/components/index.js
vendored
@ -6,6 +6,7 @@ import FormField from './FormField'
|
|||||||
import FormSelect from './FormSelect'
|
import FormSelect from './FormSelect'
|
||||||
import FormSwitch from './FormSwitch'
|
import FormSwitch from './FormSwitch'
|
||||||
import FormButtons from './FormButtons'
|
import FormButtons from './FormButtons'
|
||||||
|
import Notification from './Notification'
|
||||||
import VueFooter from './Footer'
|
import VueFooter from './Footer'
|
||||||
|
|
||||||
// Components that are registered globaly.
|
// Components that are registered globaly.
|
||||||
@ -17,6 +18,7 @@ import VueFooter from './Footer'
|
|||||||
FormSelect,
|
FormSelect,
|
||||||
FormSwitch,
|
FormSwitch,
|
||||||
FormButtons,
|
FormButtons,
|
||||||
|
Notification,
|
||||||
VueFooter,
|
VueFooter,
|
||||||
].forEach(Component => {
|
].forEach(Component => {
|
||||||
Vue.component(Component.name, Component)
|
Vue.component(Component.name, Component)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user