[Vuejs]-Vuex: Is there a "best practice" for determining whether a state change has taken place?

0👍

I suggest to use another approach:

  1. store all inputs in a component itself
  2. track changes in a components itself and set some boolean flag isChanged
  3. When a user navigates away:
if (this.isChanged) {
    // alert user
} else {
    // store all inputs to a state
    // allow user to proceed
}

Leave a comment