fix: 完善单测demo(indexedDB相关)
This commit is contained in:
@@ -1,8 +1,19 @@
|
||||
import { dbName, dbGeoDataTableName, dbDrilldownTableConfig } from '@/utils/constants'
|
||||
import Dexie from 'dexie'
|
||||
/* https://dexie.org/ */
|
||||
|
||||
export const db = new Dexie(dbName)
|
||||
db.version(2).stores({
|
||||
const db = new Dexie(dbName)
|
||||
db.version(3).stores({
|
||||
[dbGeoDataTableName]: '++name, geo',
|
||||
[dbDrilldownTableConfig]: '++id, config'
|
||||
[dbDrilldownTableConfig]: '++id, config',
|
||||
test: '++id, name'
|
||||
})
|
||||
function selectTable (tableName) {
|
||||
return db[tableName]
|
||||
}
|
||||
|
||||
const indexedDBUtils = {
|
||||
db,
|
||||
selectTable
|
||||
}
|
||||
export default indexedDBUtils
|
||||
|
||||
Reference in New Issue
Block a user