// Initialize gun
import Gun from 'gun'
// localStorage.clear()
var gun = new Gun(['https://mypeer.hostname:8765/gun'])
import VueGun from 'vue-gun';
Vue.use(VueGun, { gun: gun });
Usage in component method:
var newSourceNode = this.$gun.get(this.$uuid.v4()).put({src:"http://asdf.com"})
var zkgun = {
gun: null, // must be initialized
setGun: function(gun) {
this.gun = gun
},
...
Init:
// My Gun Lib
import zkgun from './lib/zkgun.js'
zkgun.setGun(gun)
Vue.prototype.zkgun = zkgun
Usage in component method:
var newSourceNode = this.zkgun.get(this.$uuid.v4()).put(this.newSource)