Skip to content

2 Installation

David Grill edited this page Jun 2, 2017 · 1 revision

Installation

```
npm install vue-idb --save
```

Configuration

To be enable to use vue-idb you have to make a bit of configuration. Here is the options object

{
  database: 'bigtest',
  schemas: [
    { tests: 'id, title, created_at, updated_at' },
    { bigs: 'uuid, caption, creation, update' }
  ],
  options: {
    tests: { type: 'list', primary: 'id', label: 'label', updated_at: 'updated_at' },
    bigs: { type: 'biglist', primary: 'uuid', label: 'caption', updated_at: 'update' }
  },
  apis: {
    bigs: {
      all: () => axios.get('/dev/data/bigdata.json')
    }
  }
}
  • database [required] : the IndexedDB database name
  • schemas [required] : shemas you want to manage, this is all you need to manage your data, vue-idb will create tables in IndexedDB. You can create on demand a vuex plugin and modules to serve your UI
  • options [optional] : if you don't want to use vuex, it's not for you. Here you can set by shemas options to specify type and fields required. By default values are the same as test key.
  • api [optional] : Same... just with vuex. You can set here CRUD API's calls to sync datas with back-end.

All these options will be explained in options menu section.

Clone this wiki locally