Revert this.$apollo

This commit is contained in:
Guillaume Chau
2017-08-29 13:14:50 +02:00
parent be2168223a
commit bf068cee31
+10 -1
View File
@@ -24,7 +24,6 @@ const prepare = function prepare () {
if (apollo) {
this._apolloQueries = {}
this._apolloInitData = {}
this.$apollo = new DollarApollo(this)
if (!apollo.$init) {
apollo.$init = true
@@ -114,6 +113,16 @@ export function install (Vue, options) {
return Object.assign(map, merge(toData, fromData))
}
// Lazy creation
Object.defineProperty(Vue.prototype, '$apollo', {
get () {
if (!this._apollo) {
this._apollo = new DollarApollo(this)
}
return this._apollo
},
})
Vue.mixin({
// Vue 1.x