https://github.com/sadick254/vuepouch
A tiny library to enable you work with PouchDB in a Vuejs app. It syncs with remote CouchDB too :-)
https://github.com/sadick254/vuepouch
pouchdb sync tiny-library vuejs
Last synced: 8 months ago
JSON representation
A tiny library to enable you work with PouchDB in a Vuejs app. It syncs with remote CouchDB too :-)
- Host: GitHub
- URL: https://github.com/sadick254/vuepouch
- Owner: sadick254
- Created: 2016-11-19T14:14:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-20T14:53:11.000Z (over 8 years ago)
- Last Synced: 2025-06-29T00:49:30.894Z (9 months ago)
- Topics: pouchdb, sync, tiny-library, vuejs
- Language: JavaScript
- Homepage:
- Size: 35.2 KB
- Stars: 56
- Watchers: 4
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vuepouch
A tiny library to enable you work with PouchDB in a Vuejs app. It syncs with remote CouchDB too :-)
## Installation
Installing Vuepouch is as easy as including it in your html script tag. Being that it is a vuejs mixin
it has a dependancy on vuejs. So dont forget to include that.
``` html
```
## Usage
Vuepouch by default gets auto installed when you include it in your html. You dont
have to to `Vue.use(vuepouch)`.
``` javascript
var app = new Vue({
el: "#app",
pouchdb: {
uber: {
localDB: "uber",
remoteURL: "http://127.0.0.1:5984/uber"
}
},
computed: {
drivers () {
return this.uber.drivers
},
passengers () {
return this.uber.passengers
}
}
})
```
## Adding data
``` javascript
...
methods: {
addDriver () {
this.$pouchdbRefs.uber.put('drivers',/*your data*/)
},
addPassenger () {
this.$pouchdbRefs.uber.put('passengers', /*your data*/)
}
}
```
## Deleting data
``` javascript
this.$pouchdbRefs.uber.remove(/*your data*/)
```
## Updating data
``` javascript
this.$pouchdbRefs.uber.update(/*your data*/)
```
## Displaying data in your html
``` html
- {{driver.name}}
```