fixed: receiving error if _this. is not defined #275 (#279)

* fixed: receiving error if _this. is not defined #275

* fixed: receiving error if _this. is not defined #275
This commit is contained in:
Loi Tran
2018-05-11 03:48:17 -07:00
committed by Guillaume Chau
parent 15f5c20471
commit 4eb30c780f
4 changed files with 19 additions and 4 deletions
+6 -1
View File
@@ -40,7 +40,12 @@ const launch = function launch () {
// watchQuery
for (let key in apollo) {
if (key.charAt(0) !== '$') {
if (!this.hasOwnProperty(key) && !this.$props.hasOwnProperty(key) && !this.$data.hasOwnProperty(key)) {
let propHasKeyProperty = false
if (typeof this.$props !== 'undefined') {
propHasKeyProperty = this.$props.hasOwnProperty(key)
}
if (!this.hasOwnProperty(key) && !propHasKeyProperty && !this.$data.hasOwnProperty(key)) {
Object.defineProperty(this, key, {
get: () => this.$data.$apolloData.data[key],
enumerable: true,