【发布时间】:2019-10-04 22:12:51
【问题描述】:
我已尝试通过cordova-sqlite-storage 安装此插件https://github.com/xpbrew/cordova-sqlite-storage。我用的是framework7。
看起来插件已安装,因为当我再次输入安装命令时,我看到了
C:\Users\User\Desktop\pj>cordova plugin add cordova-sqlite-storage
Plugin "cordova-sqlite-storage" already installed on android.
Plugin "cordova-sqlite-storage" already installed on browser.
Adding cordova-sqlite-storage to package.json
这是我使用 sqlite 的代码: 路由.js
routes = [
{
path: '/',
url: './index.html',
},
{
path: '/drive/',
url: './pages/drive.html',
on: {
pageInit: function (e, page) {
//db start
window.sqlitePlugin.echoTest(function() {
console.log('ECHO test OK');
alert('ECHO test OK');
});
window.sqlitePlugin.selfTest(function() {
console.log('SELF test OK');
alert('SELF test OK');
});
[...]
在控制台中我看到
TypeError: window.sqlitePlugin is undefined
【问题讨论】:
标签: sqlite cordova cordova-plugins