1
我需要在火力地堡回调如下更新VUE的财产,但它不工作,相同的更新代码如何更新承诺回调中的vue属性?
this.item_count = 0
作品VUE方法中,而不是在一个承诺回调:
methods: {
sign_out : function(e) {
this.item_count = 0
firebase.auth().signOut().then(function() {
// this.item_count = 0 // this will not set the item_count of Vue instance
})
},
[使用 “本” 在Vuejs 2.0(http://stackoverflow.com/questions/41820258/using-this-in-vuejs-2-的可能的复制0) – Saurabh