I have an UnsavedChangesModal
as a component that needs to be launched when the user tries to leave the page when he has unsaved changes in the input fields (I have three input fields in the page).
components: {
UnsavedChangesModal
},
mounted() {
window.onbeforeunload = '';
},
methods: {
alertChanges() {
}
}
beforeRouteLeave
hook – Undershoot