How to insert a piece of logic before the execution of the .then () function of the MessageBox () promise object encapsulated by elementUI

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?


use Dialog dialog box, you can do whatever you want


confirmButtonText: 'cancel',
cancelButtonText:'OK'

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bdbb18-312a8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bdbb18-312a8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?