Skip to content

Instantly share code, notes, and snippets.

@dsseng
Created February 3, 2018 15:06
Show Gist options
  • Save dsseng/561c9c9371e8701870b607991fdf7024 to your computer and use it in GitHub Desktop.
Save dsseng/561c9c9371e8701870b607991fdf7024 to your computer and use it in GitHub Desktop.
vue.js plugin for lscache
const lscache = require('lscache')
// This is your plugin object. It can be exported to be used anywhere.
const MyPlugin = {
// The install method is all that needs to exist on the plugin object.
// It takes the global Vue object as well as user-defined options.
install (Vue, options) {
// We add $ls for lscache
Vue.prototype.$ls = {
get: lscache.get,
set: lscache.set,
remove: lscache.remove
}
}
}
module.exports = MyPlugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment