nuxt ui notifications (#390)

* nuxt ui notifications

* use crispInit function

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
Favour Olayinka
2024-05-06 13:19:06 +01:00
committed by GitHub
parent 9f7cdd09fd
commit 49e6382bbb
10 changed files with 167 additions and 82 deletions

View File

@@ -74,14 +74,12 @@ watch(form, (form) => {
onBeforeRouteLeave((to, from, next) => {
if (isDirty()) {
return useAlert().confirm(
"Changes you made may not be saved. Are you sure want to leave?",
() => {
window.onbeforeunload = null
next()
},
() => {},
)
if (window.confirm('Changes you made may not be saved. Are you sure want to leave?')) {
window.onbeforeunload = null
next()
} else {
next(false)
}
}
next()
})

View File

@@ -42,16 +42,14 @@ useOpnSeoMeta({
})
onBeforeRouteLeave((to, from, next) => {
if (isDirty()) {
return useAlert().confirm(
"Changes you made may not be saved. Are you sure want to leave?",
() => {
if (this.isDirty()) {
if (window.confirm('Changes you made may not be saved. Are you sure want to leave?')) {
window.onbeforeunload = null
next()
},
() => {},
)
}
} else {
next(false)
}
}
next()
})