I want to show an error message on the web page and cancel the submission event in the beforeSubmit event of the cart component. How should I achieve this?
I wrote the following code to prevent the submit event, but the page did not show the error message,only a blank error message block
cart.on('beforeSubmit', function () {
//some code
throw new Error(`error message`)
}