OGeek|极客世界-中国程序员成长平台

标题: android - ionic 3 : storage in both IndexedDB and Web SQL [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 20:17
标题: android - ionic 3 : storage in both IndexedDB and Web SQL

我正在开发适用于安卓和 iOS 手机的移动应用程序。

我在使用 Storage 时遇到了一些非常奇怪的事情。我在 IndexedDB 和 Web SQL 中都获取数据(当我在浏览器中测试/调试时)。

这是模块的声明:

IonicStorageModule.forRoot()

我遇到了麻烦,因为当我尝试从存储中获取数据时,我从 Web SQL(包含旧值...)而不是从我拥有最新值的 IndexedDB 获取数据。

我想设置这样的首选顺序:

IonicStorageModule.forRoot({
    name: '__myprojectdb',
    driverOrder: ['indexeddb']
})

但是,它应该在 iOS 和 Android 上都能正常工作吗?是否有任何要求或首选的数据库类型取决于设备?

我对想法持开放态度!因为我是 Ionic 和移动应用程序的新手。

提前感谢您的帮助:-)



Best Answer-推荐答案


所使用的存储空间取决于您使用 Chrome with Ionic 的“检查->预览”模式。 You can find more info in this answer

关于android - ionic 3 : storage in both IndexedDB and Web SQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51058209/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4