A Vue plugin from localForage.vue-localForage or vlf
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore ok Sep 25, 2017
README.md 修复文档 May 28, 2018
index.js 修复driverName拼写错误 May 28, 2018
package.json 修复driverName拼写错误 May 28, 2018

README.md

vlf

vue-localforage

安装

npm install  --save vlf

引入即可

import Vlf from 'vlf'
Vue.use(Vlf)

方法参数:

this.$vlf.createInstance({
    storeName: 'user'
}).then((store) => {
    store.setItem('key', [])
    store.length().then((keys) => {
        console.log(keys)
    })
    store.iterate((value, key, num) => {
        return [key, value]
    }).then((result) => {
        console.log(result)
    })
})

其他的使用方法和官网都是一样的, 只是在前面加个this.$vlf, 后面的都一样!