@thclab/vue idb

IndexedDB wrapper for Vuejs based on Dexie - modification by THC Lab adding versioning

Version: 1.0.0 Updated: 03/14/2019

By: ddgll License: MIT

Downloads Last 30 Days: 13

Install

npm i @thclab/vue-idb
yarn add @thclab/vue-idb

Repository: https://github.com/ddgll/vue-idb

CDNs

bundle.run: https://bundle.run/@thclab/vue-idb

jsDelivr: https://cdn.jsdelivr.net/npm/@thclab/vue-idb

unpkg: https://unpkg.com/@thclab/vue-idb

vue-idb

IndexedDB wrapper for Vuejs based on Dexie

Install

  npm install vue-idb --save

Usage

  import Vue from 'vue'
  import VueIdb from 'vue-idb'

  Vue.use(VueIdb)

  const dbName = "database"

  const idb = new VueIdb(database, [{
    version: 1,
    schemas: [
      { tests: 'id, title, created_at, updated_at' },
            { posts: 'id, owner' }
    ]
  },
  {
    version: 2,
    schemas: [
      { cars: 'id, name, created_at, updated_at'},
    ],
    upgrade: function(tx) {
      return tx.tests.toCollection().modify(item => {
        // modify your table
      })
    }
  })

  new Vue({
    el: '#app',
    idb: idb,
    render: h => h(App)
  })
Categories: Vue js