Created
September 22, 2017 04:47
-
-
Save hitautodestruct/db4ca5aa2cfefb664ddde6bc7112b281 to your computer and use it in GitHub Desktop.
Vue js lodash plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original code example https://medium.com/@denny.headrick/mixins-and-plugins-in-vuejs-ecee9b37d1bd