fix(Dialog): some popup props not work

This commit is contained in:
chenjiahan 2020-08-26 14:09:21 +08:00
parent 627e376cfb
commit af94c92614

View File

@ -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 (
<ActionBar class={bem('footer')}>
@ -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)}