如何使用基于类别的pouchdb存储数据?

问题描述 投票:0回答:1

我需要将数据存储在myapp中,例如userdetails类别中的userdetails,模板中的模板数据。我们如何对邮袋db中的数据进行分类

offline pouchdb
1个回答
0
投票

您可以拥有一些数据库

import Vue from 'vue'
import PouchDB from 'pouchdb'

export default () => {
    const db = {
        dbModel: null,
        dbSlider: null,
        dbBook: null,
        dbContent: null,
        dbSession: null,
        dbTip: null,
        dbLecture: null,
        init() {
            this.dbModel = new PouchDB('hedayat_noor');
            this.dbSlider = new PouchDB('slider');
            this.dbBook = new PouchDB('book');
            this.dbContent = new PouchDB('content');
            this.dbSession = new PouchDB('session');
            this.dbTip = new PouchDB('tip');
            this.dbLecture = new PouchDB('lecture');
        },
    };
    db.init();
    Vue.prototype.$db = db
}
© www.soinside.com 2019 - 2024. All rights reserved.