[Vuejs]-How to track changes to the injected root instance property

0👍

Have it solved by looking at the api doc. So in my component file, I simply do it like so:

<script>

export default {
 name: "Login",
 data: function(){
   return {
     isLoggedIn: this.$authentication // remove the attribute
   }
 },
 watch: {
  'isLoggedIn.authenticated': function (){  // now access the attribute
    console.log('its working');  
  }
 },
}
</script>

now it is all good.

Leave a comment