ionic3--Cordova-sqlite-storage

1.如果需要使用SQLite,先安装 Cordova-sqlite-storage ,命令行输入

ionic cordova plugin add cordova-sqlite-storage

npm install –save @ionic-native/sqlite

2 在 ./src/app/app.module.ts 中添加

import { IonicStorageModule } from '@ionic/storage';

@NgModule({

  declarations: [...],

  imports: [

    ...,

    IonicStorageModule.forRoot({

      name: 'myApp',

      driverOrder: ['sqlite', 'indexeddb', 'websql']

    })

  ],

  bootstrap: [...],

  entryComponents: [...],

  providers: [...]

})

export class AppModule { }

    原文作者:藟Danae
    原文地址: https://www.jianshu.com/p/3a24ef9021f6
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞