antares/src/renderer/components/TheNotificationsBoard.vue

48 lines
1.1 KiB
Vue
Raw Normal View History

2020-05-15 17:52:59 +02:00
<template>
<div id="notifications-board">
<transition-group name="slide-fade">
<BaseNotification
v-for="notification in latestNotifications"
:key="notification.uid"
:message="notification.message"
:status="notification.status"
@close="removeNotification(notification.uid)"
/>
</transition-group>
</div>
</template>
<script>
import { mapGetters, mapActions } from 'vuex';
import BaseNotification from '@/components/BaseNotification';
export default {
name: 'TheNotificationsBoard',
components: {
BaseNotification
},
computed: {
...mapGetters({
notifications: 'notifications/getNotifications'
}),
latestNotifications () {
return this.notifications.slice(0, 10);
}
},
methods: {
...mapActions({
removeNotification: 'notifications/removeNotification'
})
}
};
</script>
<style lang="scss">
#notifications-board{
position: absolute;
z-index: 9;
2020-05-20 18:00:14 +02:00
right: 1rem;
2020-06-02 19:13:57 +02:00
bottom: 1rem;
2020-05-15 17:52:59 +02:00
}
</style>