Skip to content

Instantly share code, notes, and snippets.

@bradoyler
Last active March 16, 2018 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradoyler/3b706bbfbb4e3b17f4a00dd092ce78e5 to your computer and use it in GitHub Desktop.
Save bradoyler/3b706bbfbb4e3b17f4a00dd092ce78e5 to your computer and use it in GitHub Desktop.
A Vue.js plugin for idb-keyval

Vue-idb-keyval

A Vue.js plugin for idb-keyval

Setup

copy idb-keyval.js to your plugins folder in your vue app

Usage

import Vue from 'vue';
import $idb from './plugins/idb-keyval';

Vue.use($idb);

// then just use the $idb global in your Vue app
Vue.$idb.set('my.key', 'my value')
import idb from 'idb-keyval';
export default {
install (Vue, options) {
Vue.prototype.$idb = idb;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment