nuxt ui notifications (#390)
* nuxt ui notifications * use crispInit function --------- Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
@@ -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()
|
||||
})
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user