My template relies on an API call (Firebase) to determine the return value of my computed property
, which in turn decides whether certain elements are displayed.
However, I've noticed that my computed property
is not reactive - its value in the template remains unchanged even after the API call. What could be causing this?
JS:
myComputedProperty: function() {
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
return true;
}
else {
return false;
}
});
}
Template:
<span v-if="userConnected">
User connected
</span>