Advertisement
Guest User

Untitled

a guest
May 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import moment from ‘moment’;
  2. Import Vue from ‘vue’;
  3.  
  4. Object.defineProperty(Vue.prototype, ‘$moment’, {
  5.     get() { return this.moment; }
  6. });
  7.  
  8. new Vue({
  9.     data: {
  10.        moment: moment
  11.     }
  12. })
  13.  
  14. Vue.component(‘my-component’, {
  15.     …
  16.     computed: {
  17.         currentTime() {
  18.             return this.$moment();
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement