VUE报错,Cannot read properties of undefined (reading ‘then’)

app.config.globalProperties.$mb = (type:any, message:string, title:string) => {
    ElMessageBox({
        type,
        title,
        message,
        closeOnClickModal: true,
        closeOnPressEscape: true,
        callback: () => {
        }
    });
};

app.config.globalProperties.$mb = (type:any, message:string, title:string) => {
    return ElMessageBox({
        type,
        title,
        message,
        closeOnClickModal: true,
        closeOnPressEscape: true,
        callback: () => {
        }
    });
};

加个return就OK了

Logo

前往低代码交流专区

更多推荐