Skip to content

Instantly share code, notes, and snippets.

@hitautodestruct
Created September 22, 2017 04:47
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 hitautodestruct/db4ca5aa2cfefb664ddde6bc7112b281 to your computer and use it in GitHub Desktop.
Save hitautodestruct/db4ca5aa2cfefb664ddde6bc7112b281 to your computer and use it in GitHub Desktop.
Vue js lodash plugin
//Original here - https://medium.com/@denny.headrick/mixins-and-plugins-in-vuejs-ecee9b37d1bd
//lodashPlugin.js
import _ from 'lodash';
let lodashPlugin = {};
lodashPlugin.install = function (Vue, options) {
Vue.prototype.$_ = _;
};
//app.js
import Vue from 'vue';
import lodashPlugin from 'lodashPlugin.js';
Vue.use(lodashPlugin);
@hitautodestruct
Copy link
Author

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