Skip to content

Commit 0345373

Browse files
author
Guillaume Chau
committed
fix: watching and computing of dynamic data props
1 parent 906975e commit 0345373

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/mixin.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ function initDollarApollo () {
2727
}
2828

2929
function proxyData () {
30-
let apollo = this.$options.apollo
30+
this.$_apolloInitData = {}
3131

32+
let apollo = this.$options.apollo
3233
if (apollo) {
33-
this.$_apolloInitData = {}
3434
// watchQuery
3535
for (let key in apollo) {
3636
if (key.charAt(0) !== '$') {
@@ -84,11 +84,6 @@ function launch () {
8484
configurable: true,
8585
})
8686

87-
// Init data
88-
for (let key in this.$_apolloInitData) {
89-
this.$set(this.$data.$apolloData.data, key, this.$_apolloInitData[key])
90-
}
91-
9287
// watchQuery
9388
for (let key in apollo) {
9489
if (key.charAt(0) !== '$') {
@@ -131,7 +126,7 @@ export function installMixin (Vue, vueVersion) {
131126
'$apolloData': {
132127
queries: {},
133128
loading: 0,
134-
data: {},
129+
data: this.$_apolloInitData,
135130
},
136131
}
137132
},

0 commit comments

Comments
 (0)