This is a small wrapper for integrating lodash into VueJs
Switch branches/tags
Clone or download
Latest commit c35cd7a Mar 22, 2018
Permalink
Failed to load latest commit information.
dist feat: add user custom name. Mar 23, 2018
src feat: add user custom name. Mar 23, 2018
.babelrc v1.0.0 Apr 22, 2017
.gitignore v1.0.0 Apr 22, 2017
LICENSE v1.0.0 Apr 22, 2017
README.md edit readme Mar 23, 2018
gulpfile.js use gulp instead of webpack Apr 22, 2017
package-lock.json feat: add user custom name. Mar 23, 2018
package.json update README Mar 23, 2018

README.md

vue-lodash

A small wrapper for integrating lodash to Vuejs (Inspired by vue-axios plugin by imcvampire)

When to use it and when not to:

Use it when using lodash extensively in lots of file.

Don't use it if just want some simple functions from lodash. (My recommendation is to install individual small function from lodash.)

For vue-lodash 2.x

npm install --save vue-lodash

And in your entry file:

import Vue from 'vue'
import VueLodash from 'vue-lodash'

const options = { name: 'lodash' } // customize the way you want to call it

Vue.use(VueLodash, options) // options is optional

Usage:

This wrapper bind lodash to Vue or this if you're using single file component.

You can use lodash like this:

// with name option
Vue.myCustomName.random(20)
this.myCustomName.random(20)

// default (it works even with custom name)
Vue._.random(20)
this._.random(20)

For vue-lodash 1.x

npm install --save lodash vue-lodash

And in your entry file:

import Vue from 'vue'
import lodash from 'lodash'
import VueLodash from 'vue-lodash'

Vue.use(VueLodash, lodash)

Usage:

This wrapper bind lodash to Vue or this if you're using single file component.

You can lodash like this:

Vue._.random(20)
this._.random(20)