3
我有一個孩子的組件,有以下方法:Vue.js訪問父組件
getSubscriptions() {
MessageService.subscriptions()
this.$parent.loading = true;
.then((data) => {
if (data.data.subscriptions == null) {
this.noSubscriptions = true;
} else {
this.subscriptions = data.data.subscriptions;
}
this.$parent.loading = false;
}).bind(this);
}
所以我想說明的負載循環在我父組件訪問它是這樣的:
this.$parent.loading
(我的父組件有一個名爲loading
數據屬性)
但是,當我嘗試編譯與一飲而盡^我得到:
[14:52:56] Starting 'browserify'...
46 | }
47 |
> 48 | t this.$parent.loading = false;
| ^
49 | }).bind(this);
50 | },
51 |
{ SyntaxError: unknown: Unexpected token (48:28)
46 | }
47 |
> 48 | t this.$parent.loading = false;
| ^
49 | }).bind(this);
50 | },
這裏有什麼問題?
(我使用Vue.js 1.0
)