Я строю простой проект Vue, чтобы разобраться с простым магазином (vuex), а затем с помощью PouchDB.Я сталкиваюсь с странной ошибкой и пытаюсь понять, куда идти дальше.
const PouchDB = require('pouchdb')
import EntryForm from '@/components/EntryForm.vue'
import DisplayText from '@/components/DisplayText.vue'
export default {
name: 'entryform',
components: {
EntryForm,
DisplayText
},
data() {
return {
db: [],
remote: [],
stepfwd: [],
stepback: [],
newMutation: true
}
},
created() {
//window.db or this.db does it matter ?
this.db = new PouchDB('icecream')
this.remote = 'http://localhost:5984/icecream'
this.db.sync(this.remote, { live: true, retry: true })
//any mutations are put into the stepfwd array and put into the db array
this.$store.subscribe(mutation => {
if (mutation.type !== CLEAR_STATE) {
this.stepfwd.push(mutation)
this.db.push(mutation)
}
if (this.newMutation) {
this.stepback = []
}
})
}
Любые помощники высоко ценятся.
весь код филиала можно найти здесь для просмотра https://gitlab.adamprocter.co.uk/adamprocter/simplevuestore/tree/pouchdb