What if the browser retreats when the vue layer pops up?

when the user submits the submit, the loading layer pops up, but the request server needs time to respond. At this time, the loading layer is still on the page and does not look very beautiful. Is there any way to prohibit the user from going back

?
Sep.09,2021

you mean that the user submits the request and then steps back. The loading is still on the page, right? If the problem is this, you can terminate the request when you switch the page, and the loading status will also be terminated. I don't know if what I understand is consistent with what you want


methods:{},
beforeRouteLeave(to,from,next){
    //
    // 
    next() // next
}
.
Menu