Closed vdcrea closed 6 years ago
Ok I finally got it, reading the source and testing, vue-cli's webpack may not like to require the plugins.
This doesn't work with vue-cli's webpack template:
const bucket = new VuePouchDB.Bucket({
plugins: [
require('pouchdb-authentication')
]
})
But this works:
import PouchdbAuthentication from 'pouchdb-authentication'
const bucket = new VuePouchDB.Bucket({
plugins: [
PouchdbAuthentication
]
})
Then to trigger the plugin's method, use a named db, ex: this.$bucket.db('dbname').login(username, password)
.
Hi, and thanks for this vue plugin.
Is it possible to trigger a plugin's method from Vue logic? I'am trying to use
pouchdb-authentication
, so configured my global set for vue-pouch-db like that:I tried
this.$bucket.login()
andthis.$bucket.state.login()
but I run out of idea to understand how to use plugins.