feat(Dialog): add width prop (#4687)

This commit is contained in:
neverland
2019-10-11 10:13:33 +08:00
committed by GitHub
parent 894e9aafcb
commit cc162ecd7b
6 changed files with 20 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
import { createNamespace } from '../utils';
import { createNamespace, addUnit } from '../utils';
import { BORDER_TOP, BORDER_LEFT } from '../utils/constant';
import { PopupMixin } from '../mixins/popup';
import { CloseOnPopstateMixin } from '../mixins/close-on-popstate';
@@ -11,6 +11,7 @@ export default createComponent({
props: {
title: String,
width: [Number, String],
message: String,
className: null,
callback: Function,
@@ -153,6 +154,7 @@ export default createComponent({
role="dialog"
aria-labelledby={this.title || message}
class={[bem(), this.className]}
style={{ width: addUnit(this.width) }}
>
{Title}
{Content}