sweebee
sweebee

Reputation: 59

import JS (websql) library in Vue

I'm used to use this WebSQL wrapper: https://github.com/psayre23/WebSQL

I want to use this in my Vue project, but I can't get it working. I did the following:

import * as WebSQL from './WebSQL';
var db = WebSQL('test');

Object.defineProperty(Vue.prototype, '$db', { value: db });

also tried:

require('./WebSQL');
var db = WebSQL('test');

Object.defineProperty(Vue.prototype, '$db', { value: db });

But I keep getting:

Can't find variable: WebSQL (WebSQL.js:429)

Upvotes: 0

Views: 900

Answers (1)

Max Liashuk
Max Liashuk

Reputation: 1053

The repo you have provided is out-of-date. Last update was 5 years ago.

  • The library is not compatible with webpack. E.g. this will not work
import * as WebSQL from './WebSQL';

Upvotes: 1

Related Questions