Created
February 3, 2018 15:06
-
-
Save dsseng/561c9c9371e8701870b607991fdf7024 to your computer and use it in GitHub Desktop.
vue.js plugin for lscache
This file contains 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
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