ionic4 - 使用 SQLite TypeError:无法读取 null 的属性“事务”
解决方案
您已经编写了事务,但是我告诉您 SQLite 插件中没有事务的属性,您需要添加 write create 属性,无论是打开还是创建数据库。喜欢=>
this.sqlite.create({
name: 'data.db',
location: 'default'
})
.then((db: SQLiteObject) =>
db.executeSql('create table danceMoves(name VARCHAR(32))', [])
.then(() => console.log('Executed SQL'))
.catch(e => console.log(e));
})
.catch(e => console.log(e));