1.0.6 • Published 5 years ago

vue-reactive-clock v1.0.6

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

Vue reactive clock plugin

What is it good for ?

This plugin helps build time reactive UIs

A few examples where it might be useful :

  • If you want to display a clock that updates as time goes by
  • If you have a live dashboard with the current day's info, when passing to the next day, you'll want it to automatically update.

Usage:

Hook up the plugin to your Vue

import Clock from 'vue-reactive-clock'

Vue.use(Clock);

This will add a $clock property to your Vue which self updates.

It can be used directly in the templates ...

<template>
 <div>
    Today's date : {{ $clock.now | formatFilter }}
 </div>
</template>

You can use $clock programatically in your computed properties to have your UI update as time passes

computed: {
  isUrgent() {
    let d =  new Date(this.$clock.now);
    return d.getHours() > 18;
  }
}
1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago