From af94c92614b78e999e5377208e2c3c3672480210 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Wed, 26 Aug 2020 14:09:21 +0800 Subject: [PATCH] fix(Dialog): some popup props not work --- src/dialog/Dialog.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/dialog/Dialog.js b/src/dialog/Dialog.js index 51a9150ae..469f835e2 100644 --- a/src/dialog/Dialog.js +++ b/src/dialog/Dialog.js @@ -1,4 +1,4 @@ -import { createNamespace, addUnit } from '../utils'; +import { createNamespace, addUnit, pick } from '../utils'; import { BORDER_TOP, BORDER_LEFT } from '../utils/constant'; import Popup from '../popup'; import Button from '../button'; @@ -90,13 +90,17 @@ export default createComponent({ }, onClose(action) { - this.$emit('update:show', false); + this.onUpdateShow(false); if (this.callback) { this.callback(action); } }, + onUpdateShow(value) { + this.$emit('update:show', value); + }, + genRoundButtons() { return ( @@ -204,9 +208,17 @@ export default createComponent({ role="dialog" class={[bem([this.theme]), this.className]} style={{ width: addUnit(this.width) }} - transition={this.transition} - lazyRender={this.lazyRender} aria-labelledby={this.title || message} + {...{ + ...pick(this, [ + 'overlay', + 'transition', + 'lazyRender', + 'closeOnPopstate', + 'closeOnClickOverlay', + ]), + 'onUpdate:show': this.onUpdateShow, + }} > {Title} {this.genContent(title)}