There is code to handle the button to close the page and initialize submit
window.onbeforeunload = function(e) {
var dialogText = 'Dialog text here';
e.returnValue = dialogText;
return dialogText;
};
How to use JavaScript to process this function in Vue JS to send the form through HTML tags? I did similar things on Jinja, but I can specify data directly in the URL