A small wrapper for integrating lodash to Vue.js (inspired by vue-axios plugin by imcvampire)
npm install lodash-for-vue --save
OR
yarn add lodash-for-vue
And in your entry file:
import Vue from 'vue'
import LodashForVue from 'lodash-for-vue'
Vue.use(LodashForVue)
Just add 2 scripts in order: vue
and vue-lodash
to your document
.
This wrapper bind lodash
to Vue
or this
if you're using single file component.
You can lodash
like this:
Vue.$lodash.random(20)
this.$lodash.random(20)