- Added VueIdb plugins: $db.mytable.add({myelem:'value'}) to insert a record, and $db.mytable.toArray() to receive the array.

This commit is contained in:
Paolo Arena
2019-01-05 23:34:29 +01:00
parent fd2321cd20
commit 46609baef8
7 changed files with 87 additions and 43 deletions

28
src/plugins/vue-idb.js Normal file
View File

@@ -0,0 +1,28 @@
import Vue from 'vue'
import VueIdb from 'vue-idb'
export default ({ Vue }) => {
Vue.use(VueIdb)
// Insert here the database for IndexDB
new VueIdb({
version: 1,
database: 'test',
schemas: [
{ categories: '++id, sub_categ_id, descr_it' }
]
})
}
/*
export default new VueIdb({
version: 1,
database: 'test',
schemas: [
{ categories: '++id, sub_categ_id, descr_it' }
]
})
*/