'Wait when variable change status in Vue

How I can run some code when my variable change.

for exaple: $store.state.AppStatus have status "busy" when vue component loaded then he change to "ready"

so i need run boostrap function on tab after $store.state.AppStatus change to "ready"

Now i use setTimeout couse its work but its not perfect...

My code mounted hook:

  mounted() {
    
    if (window.location.hash) {
      console.log(this.$store.state.AppStatus)
       setTimeout(() => {
            $(`a[href="${window.location.hash}"]`).tab('show')
          }, 1000);
      
    }  
  },


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source