Browse Source

update Message component

pull/342/head
Guillaume Vincent 7 years ago
parent
commit
807762693f
1 changed files with 28 additions and 4 deletions
  1. +28
    -4
      src/components/Message.vue

+ 28
- 4
src/components/Message.vue View File

@@ -1,8 +1,12 @@
<style>
.fade-enter-active, .fade-leave-active {
.fade-enter-active {
transition: opacity .5s
}

.fade-leave-active {
transition: opacity 2s
}

.fade-enter, .fade-leave-to {
opacity: 0
}
@@ -14,16 +18,27 @@
right: 0;
z-index: 20;
}

.close-notification{
float: right;
position: absolute;
top:0;
right: 1em;
cursor: pointer;
}
</style>
<template>
<div id="message">
<div id="message" v-on:click="keepMessage">
<transition name="fade">
<div v-if="message.text">
<div class="card-header text-white"
v-bind:class="{ 'card-warning': message.status==='warning', 'card-danger': message.status==='error', 'card-success': message.status==='success' }">
<div class="row">
<div class="col-12">
<small>message</small>
<small>{{message.text}}</small>
<span class="close-notification" v-on:click="hideMessage">
<i class="fa fa-close"></i>
</span>
</div>
</div>
</div>
@@ -33,10 +48,19 @@
</template>
<script type="text/ecmascript-6">
import {mapGetters} from 'vuex';
import message from '../services/message';

export default {
computed: mapGetters([
'message'
])
]),
methods: {
keepMessage(){
message.keepMessage();
},
hideMessage(){
message.hideMessage();
}
}
}
</script>

Loading…
Cancel
Save