Skip to content

Files

Latest commit

 

History

History
44 lines (31 loc) · 913 Bytes

README.md

File metadata and controls

44 lines (31 loc) · 913 Bytes

vueuseindexeddb

An indexedDB wrapper for Vue3 Composition API

Current version: 0.1.4

Must use with Vue3, as a composition API.

usage: install via npm/yarn:

npm install vueuseindexeddb
or
yarn add vueuseindexeddb

... then in your project

import {useIndexedDB} from "vueuseindexeddb";

const {currentDB: DeepReadonly,
    currentDBName: DeepReadonly,
    currentDBVersion: DeepReadonly,
    getData :function,
    getAllData :function,
    addData :function,
    updateData:function,
    removeData:function} = useIndexedDB();

All functions return Promise, which could be used with async/await syntax.

DBVersion and DBName can be set as the parameter of useIndexedDB(), as follows:

const {currentDBName,currentDBVersion} = useIndexedDB("TestDBNAME",2);

console.log(currentDBName,currentDBVersion);

Much to add yet, but it's usable now as it is :)

Enjoy~