notify.vue 1.04 KB
Newer Older
1 2 3 4 5 6
<template lang='pug'>
  v-snackbar.nav-notify(
    :color='notification.style'
    top
    multi-line
    v-model='notificationState'
7
    :timeout='6000'
8
    )
9 10
    .text-left
      v-icon.mr-3(dark) mdi-{{ notification.icon }}
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
      span {{ notification.message }}
</template>

<script>
import { get, sync } from 'vuex-pathify'

export default {
  data() {
    return { }
  },
  computed: {
    notification: get('notification'),
    notificationState: sync('notification@isActive')
  }
}
</script>

<style lang='scss'>
.nav-notify {
30 31
  top: -64px;
  padding-top: 0;
32 33
  z-index: 999;

34 35 36
  .v-snack__wrapper {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
37
    position: relative;
38
    margin-top: 0;
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62

    &::after {
      content: '';
      display: block;
      width: 100%;
      height: 2px;
      background-color: rgba(255,255,255,.4);
      position: absolute;
      bottom: 0;
      left: 0;
      animation: nav-notify-anim 6s linear;
    }
  }
}

@keyframes nav-notify-anim {
  0% {
    width: 100%;
  }
  100% {
    width: 0%;
  }
}
</style>