2 formas de escribir ventanas emergentes en aplicaciones

El primero: uso de $confirm()

 handleClose() {
            if (isChange) {
                this.dialogVisible = true;
                this.$confirm('是否关闭?您所做的更改并未保存。', '确认信息', {
                    distinguishCancelAndClose: true,
                    confirmButtonText: '保存',
                    cancelButtonText: '关闭',
                    showClose: false,
                })
                .then(() => {
                    this.handleSave();
                    this.dialogVisible = false;
                    isChange = false;
                })
                .catch(action => {
                    this.dialogVisible = false;
                    this.updateSelectedList();
                    isChange = false;
                })
            }
        },

Segundo tipo: uso de $alert()  

handleSave() {
            batchSaveApi(this.selectedList).then(res => {
                this.updateQuickNav();
                this.$alert('快捷键设置成功!', '消息', {
                    confirmButtonText: '确定',
                    callback: ()=> {
                        this.dialogVisible = false;
                    }
                });
            });
            isChange = false;
           
        },

Supongo que te gusta

Origin blog.csdn.net/lv_suri/article/details/130822989
Recomendado
Clasificación