Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add property check for
Browse files Browse the repository at this point in the history
LukasBombach committed Aug 17, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b894196 commit 31fa15a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -123,14 +123,16 @@ export function install (Vue, options) {
}

// Lazy creation
Object.defineProperty(Vue.prototype, '$apollo', {
get () {
if (!this._apollo) {
this._apollo = new DollarApollo(this)
}
return this._apollo
},
})
if (!Vue.prototype.hasOwnProperty('$apollo')) {
Object.defineProperty(Vue.prototype, '$apollo', {
get () {
if (!this._apollo) {
this._apollo = new DollarApollo(this)
}
return this._apollo
},
})
}

const vueVersion = Vue.version.substr(0, Vue.version.indexOf('.'))

0 comments on commit 31fa15a

Please sign in to comment.