From 31fa15afe32e4c3998f7c4efbde9a5ca26335572 Mon Sep 17 00:00:00 2001 From: Lukas Bombach Date: Fri, 17 Aug 2018 12:28:27 +0200 Subject: [PATCH] Add property check for --- src/index.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/index.js b/src/index.js index 1fa6f36d..fe82b7f0 100644 --- a/src/index.js +++ b/src/index.js @@ -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('.'))