Без опису

Sadick 8f3e5dfafd webpack output as a library 8 роки тому
dist 6c9bf5b2ce still fighting with npm 8 роки тому
src 62d8a84e0d initial npm commit 8 роки тому
.gitignore 6c9bf5b2ce still fighting with npm 8 роки тому
README.md b12dc1da05 fixed deleting while not sysncing to remote db 8 роки тому
package.json c24816a4e7 trying to fix install via npm 8 роки тому
webpack.config.js 8f3e5dfafd webpack output as a library 8 роки тому
yarn.lock 62d8a84e0d initial npm commit 8 роки тому

README.md

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 plugin it has a dependancy on vuejs. So dont forget to include that.

<script src="vue.js"></script>
<script src="vuepouch.js"></script>

Usage

Vuepouch by default gets auto installed when you include it in your html. You dont have to to Vue.use(vuepouch).

var app = new Vue({
  el: "#app",
  pouchdb: {
    todos: {
      localdb: "todos",
      remoteURL: "http://127.0.0.1:5984/todos"
    }
  }
})

Adding data

...
methods: {
  addData: function(){
    this.$pouchdbRefs.todos.push(/*your data*/)
  }
}

Deleting data

this.$pouchdbRefs.todos.delete(/*your data*/)

Updating data

this.$pouchdbRefs.todos.update(/*your data*/)

Displaying data in your html

<div id="app">
  <ul>
    <li v-for="t in todos">{{t}}</li>
  </ul>
</div>