From 3bed02995df86f44071cc4e72fc8269b362f3b15 Mon Sep 17 00:00:00 2001 From: cookfront Date: Thu, 16 Feb 2017 17:15:35 +0800 Subject: [PATCH] dialog component --- packages/dialog/src/dialog.js | 4 ++-- src/mixins/popup/popup-manager.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/dialog/src/dialog.js b/packages/dialog/src/dialog.js index 0a3ff9623..fa295ac15 100644 --- a/packages/dialog/src/dialog.js +++ b/packages/dialog/src/dialog.js @@ -24,7 +24,7 @@ const defaultCallback = action => { } }; -var initInstance = () => { +const initInstance = () => { instance = new DialogConstructor({ el: document.createElement('div') }); @@ -32,7 +32,7 @@ var initInstance = () => { instance.callback = defaultCallback; }; -var showNextDialog = () => { +const showNextDialog = () => { if (!instance) { initInstance(); } diff --git a/src/mixins/popup/popup-manager.js b/src/mixins/popup/popup-manager.js index c339df3a9..9ba799094 100644 --- a/src/mixins/popup/popup-manager.js +++ b/src/mixins/popup/popup-manager.js @@ -52,6 +52,9 @@ const PopupManager = { } }, + /** + * 遮罩层点击回调,`closeOnClickOverlay`为`true`时会关闭当前`popup` + */ handleOverlayClick() { const topModal = PopupManager.modalStack[PopupManager.modalStack.length - 1]; if (!topModal) return;