fix: #239 skip prop proxy if query is manual
This commit is contained in:
+1
-1
@@ -56,7 +56,7 @@ const launch = function launch () {
|
||||
options = Object.assign({}, apollo.$query, options)
|
||||
}
|
||||
// Property proxy
|
||||
if (!hasProperty(this, key) && !hasProperty(this.$props, key) && !hasProperty(this.$data, key)) {
|
||||
if (!options.manual && !hasProperty(this, key) && !hasProperty(this.$props, key) && !hasProperty(this.$data, key)) {
|
||||
Object.defineProperty(this, key, {
|
||||
get: () => this.$data.$apolloData.data[key],
|
||||
enumerable: true,
|
||||
|
||||
+15
-13
@@ -24,19 +24,21 @@ export default class SmartQuery extends SmartApollo {
|
||||
|
||||
super(vm, key, options, autostart)
|
||||
|
||||
this.hasDataField = this.vm.$data.hasOwnProperty(key)
|
||||
if (this.hasDataField) {
|
||||
Object.defineProperty(this.vm.$data.$apolloData.data, key, {
|
||||
get: () => this.vm.$data[key],
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
})
|
||||
} else {
|
||||
Object.defineProperty(this.vm.$data, key, {
|
||||
get: () => this.vm.$data.$apolloData.data[key],
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
})
|
||||
if (!options.manual) {
|
||||
this.hasDataField = this.vm.$data.hasOwnProperty(key)
|
||||
if (this.hasDataField) {
|
||||
Object.defineProperty(this.vm.$data.$apolloData.data, key, {
|
||||
get: () => this.vm.$data[key],
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
})
|
||||
} else {
|
||||
Object.defineProperty(this.vm.$data, key, {
|
||||
get: () => this.vm.$data.$apolloData.data[key],
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user