MessageBox()
.then(() => {
console.log(1)
}).catch(() => {
console.log(2)
})
MessageBox () is a pop-up window method encapsulated by elementUI. The pop-up window method contains a confirm and cancel button. Make sure to go then () and cancel catch ()
.this method opens the pop-up window by default and lets the OK button get focus.
and I want the cancel button to get focus by default,
MessageBox does not provide a corresponding api, but can only write its own logic implementation.
so how can I, after the pop-up window opens,
before clicking the OK and cancel buttons,
insert a piece of code to execute the logic that gives the cancel button focus?