重复
重复
  • 发布:2019-07-12 03:14
  • 更新:2019-08-09 11:04
  • 阅读:242

【报Bug】uniapp使用sqlite时出错

分类:uni-app

详细问题描述

(DCloud产品不会有明显的bug,所以你遇到的问题大都是在特定环境下才能重现的问题,请仔细描述你的环境和重现方式,否则DCloud很难排查解决你的问题)

[内容]
plus.sqlite.openDatabase({
name: 'vad_db',
path: '_doc/x.db',
success: (e) => {
console.log('openDatabase success!');
plus.sqlite.executeSql({
name: "vaddb",
sql: "create table if not exists tasks(id int, state int, expire date, file char(20))",
success: (e) => {
console.log('create task table success')
},
fail: (e) => {
console.log('create task table failed')
}
})
//vm.loadList();
},
fail: (e) => {
console.log('openDatabase failed: '+JSON.stringify(e));
}
});

重现步骤

[步骤]

[结果]
03:08:00.560 TypeError: y.indexOf is not a function
03:08:00.580 at (uniapp://ready:1:4213)
03:08:00.600 at Object.freeze.removeTextView (uniapp://ready:1:19721)
03:08:00.620 at Object.window.PlusJSCore.invokeHandler (uniapp://ready:1:25415)
03:08:00.640 at uniapp://ready:182:789
03:08:00.660 at Object.invoke (uniapp://ready:182:847)
03:08:00.680 at uniapp://ready:182:89195
03:08:00.700 at p (uniapp://ready:182:89078)
03:08:00.720 at Object.f [as invoke] (uniapp://ready:182:89152)
03:08:00.740 at window.exparser.registerBehavior.methods.removeNativeView (uniapp://ready:182:304935)
03:08:00.760 at window.exparser.registerBehavior.methods.consumeRemovingNodes (uniapp://ready:182:291245) at uniapp://ready:182
03:08:00.780 webviewScriptError
03:08:00.801 y.indexOf is not a function
03:08:00.821 TypeError: y.indexOf is not a function
03:08:00.841 at
(uniapp://ready:1:4213)
03:08:00.861 at Object.freeze.removeTextView (uniapp://ready:1:19721)
03:08:00.881 at Object.window.PlusJSCore.invokeHandler (uniapp://ready:1:25415)
03:08:00.901 at uniapp://ready:182:789
03:08:00.921 at Object.invoke (uniapp://ready:182:847)
03:08:00.941 at uniapp://ready:182:89195
03:08:00.961 at p (uniapp://ready:182:89078)
03:08:00.981 at Object.f [as invoke] (uniapp://ready:182:89152)
03:08:01.001 at window.exparser.registerBehavior.methods.removeNativeView (uniapp://ready:182:304935)
03:08:01.021 at window.exparser.registerBehavior.methods.consumeRemovingNodes (uniapp://ready:182:291245) at uniapp://ready:182
03:08:01.041 Uncaught TypeError: y.indexOf is not a function at uniapp://ready:1
[期望]

[如果语言难以表述清晰,拍一个视频或截图,有图有真相]

IDE运行环境说明

[HBuilder 或 HBuilderX。如果你用其他工具开发uni-app,也需要在此说明]

[IDE版本号]
2.0.1.20190614
[windows版本号]
Win8.1专业版
[mac版本号]

uni-app运行环境说明

[运行端是h5或app或某个小程序?]

[运行端版本号]

[项目是cli创建的还是HBuilderX创建的?如果是cli创建的,请更新到最新版cli再试]
HBuilderX创建的
[编译模式是老模板模式还是新的自定义组件模式?]
无组件

App运行环境说明

[Android版本号]

[iOS版本号]

[手机型号]

[模拟器型号]

附件

[IDE问题请提供HBuilderX运行日志。菜单帮助-查看运行日志,点右键打开文件所在目录,将log文件压缩成zip包上传]

[App问题请提供可重现问题的代码片段,你补充的细一点,问题就解决的快一点]

[App安装包或H5地址]

[可重现代码片段]

联系方式

[QQ]

2019-07-12 03:14 分享
已邀请:
重复

重复 (作者)

2.1.0.20190713版本中已修复

921357950@qq.com

921357950@qq.com

大佬,最近项目也有需要使用sqlite的需求,可以指教下吗

要回复问题请先登录注册