mounted() {
this.$store.watch(
() => this.$store.getters['content/hasChanges'](),
(newValue, oldValue) => {
// If `newValue` is `true` then the state has changed from "no changes" to "changes".
// if `newValue` is `false` then the state has changed from "changes" to "no changes".
}
)
}
crossing the same problem to solve this. Thanks for your solution, problem is, that this also is triggered on hitting save:
this.$store.watch(
() => this.$store.getters['content/hasChanges'](),
(newValue, oldValue) => {
if( !newValue ) {
console.log('revert'); // also on save
}
// If `newValue` is `true` then the state has changed from "no changes" to "changes".
// if `newValue` is `false` then the state has changed from "changes" to "no changes".
}
)