-
Notifications
You must be signed in to change notification settings - Fork 20
2 Installation
David Grill edited this page Jun 2, 2017
·
1 revision
```
npm install vue-idb --save
```
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.