Skip to content

Instantly share code, notes, and snippets.

@vuejsdevelopers
Created June 20, 2017 04:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vuejsdevelopers/d3e63d0b2146435e405baeaf33c1be9a to your computer and use it in GitHub Desktop.
Save vuejsdevelopers/d3e63d0b2146435e405baeaf33c1be9a to your computer and use it in GitHub Desktop.
Use Any Javascript Library With Vue.js - Snippet 04
import moment from 'moment';
Object.definePrototype(Vue.prototype, '$moment', { value: moment });
@gomako
Copy link

gomako commented Jun 23, 2017

Think this should be Object.defineProperty ? I could well be wrong but am getting an error when I try it as it is at the moment?

@jezmck
Copy link

jezmck commented May 24, 2019

Think this should be Object.defineProperty ? I could well be wrong but am getting an error when I try it as it is at the moment?

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment