From c60fc16cdc40ed8617ae3c65c9c6b8fe2a29bd95 Mon Sep 17 00:00:00 2001 From: Romesum Date: Tue, 26 May 2020 01:25:45 +0800 Subject: [PATCH] =?UTF-8?q?[feat][V]:=E6=96=B0=E5=A2=9E=E8=AF=A2=E9=97=AE?= =?UTF-8?q?=E6=A1=86=E5=B8=A6reject=E5=B7=A5=E5=85=B7=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- element-vue/src/utils/dialog.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/element-vue/src/utils/dialog.js b/element-vue/src/utils/dialog.js index b8de8ee..a6cecf9 100644 --- a/element-vue/src/utils/dialog.js +++ b/element-vue/src/utils/dialog.js @@ -10,6 +10,19 @@ export async function showDialog(content,that){ }).catch(() => {}); }) } + +//询问框带reject +export async function showDialogWithReject(content,that){ + return new Promise((resolve, reject) => { + that.$confirm(content, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + resolve() + }).catch(() => {reject()}); + }) +} // 显示操作成功 export function showSuccess(content,that) { that.$message({