repos
/ timestrap-django master

timestrap-django

mirror archived upstream

Time tracking you can host anywhere, built on Django. Full export support in multiple formats and easily extensible.

djangodockerhandcodedpythonself-hostedtime-trackingtimetracker

915 B · 50 lines · vue Raw History
 1<template>
 2<div class="toast float-right" role="alert" aria-live="assertive" aria-atomic="true" data-delay="5000">
 3  <div class="toast-header">
 4    <strong class="mr-auto">{{ toast.title }}</strong>
 5    <button type="button" class="ml-2 mb-1 close" data-dismiss="toast" aria-label="Close">
 6      <span aria-hidden="true">&times;</span>
 7    </button>
 8  </div>
 9  <div class="toast-body">
10    {{ toast.message }}
11  </div>
12</div>
13</template>
14
15
16<script>
17import $ from 'jquery';
18
19
20export default {
21  data() {
22    return {
23      toast: {
24        title: null,
25        message: null,
26      }
27    }
28  },
29  mounted() {
30    const self = this;
31    this.$bus.$on('toast', function(data) {
32      self.toast = data;
33      setTimeout(function() {
34        $(self.$el).toast('show');
35      }, 2000);
36    })
37  },
38};
39</script>
40
41
42<style lang="scss">
43.toast {
44  position: absolute;
45  top: 100px;
46  right: 25px;
47  z-index: 100;
48}
49</style>