Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import moment from ‘moment’;
- Import Vue from ‘vue’;
- Object.defineProperty(Vue.prototype, ‘$moment’, {
- get() { return this.moment; }
- });
- new Vue({
- data: {
- moment: moment
- }
- })
- Vue.component(‘my-component’, {
- …
- computed: {
- currentTime() {
- return this.$moment();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement