Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmlzj/vlf
A Vue plugin from localForage.vue-localForage or vlf
https://github.com/dmlzj/vlf
indexeddb localforage localstorage storage vlf vue vue-localforage websql
Last synced: 3 months ago
JSON representation
A Vue plugin from localForage.vue-localForage or vlf
- Host: GitHub
- URL: https://github.com/dmlzj/vlf
- Owner: dmlzj
- Created: 2017-09-25T03:16:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T13:34:58.000Z (about 2 years ago)
- Last Synced: 2024-09-21T10:28:14.804Z (4 months ago)
- Topics: indexeddb, localforage, localstorage, storage, vlf, vue, vue-localforage, websql
- Language: JavaScript
- Homepage:
- Size: 1.4 MB
- Stars: 119
- Watchers: 3
- Forks: 5
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vlf
vue-localforage and support typescript
> localForage is a fast and simple storage library for JavaScript. localForage improves the offline experience of your web app by using asynchronous storage (IndexedDB or WebSQL) with a simple, `localStorage`-like API.
> localForage uses localStorage in browsers with no IndexedDB or WebSQL support. See [the wiki for detailed compatibility info][supported browsers].
- [localforage repository](https://github.com/localForage/localForage)
- [localforage documentation](https://localforage.github.io/localForage/)## Install
```bash
npm install --save localforage vlf
```## How to use vlf
```javascript
import Vlf from 'vlf'
import localforage from 'localforage'
Vue.use(Vlf, localforage)
```## In your code
```javascript
// 创建实例
this.$vlf.createInstance({
storeName: 'user'
})
// 迭代
this.$vlf.iterate((value, key, num) => {
console.log(key);
});
// 设置值
this.$vlf.setItem('test', 'hello').then(v => {
console.log(v);
});// ...和官方调用一致
// The other methods of use are the same as the official website, just add a this.$vlf in front, the same behind!```
---