アプリケーションにポップアップ ウィンドウを作成する 2 つの方法

1 つ目: $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;
                })
            }
        },

2 番目のタイプ: $alert() の使用法  

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

おすすめ

転載: blog.csdn.net/lv_suri/article/details/130822989