Merge pull request #2568 from lison16/modal

add closable props for $Modal https://github.com/iview/iview/issues/2362
This commit is contained in:
Aresn 2017-12-11 09:43:38 +08:00 committed by GitHub
commit abb2cae6da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View file

@ -22,7 +22,8 @@ Modal.newInstance = properties => {
showCancel: false,
loading: false,
buttonLoading: false,
scrollable: false
scrollable: false,
closable: true
}),
render (h) {
let footerVNodes = [];
@ -80,7 +81,8 @@ Modal.newInstance = properties => {
return h(Modal, {
props: Object.assign({}, _props, {
width: this.width,
scrollable: this.scrollable
scrollable: this.scrollable,
closable: this.closable
}),
domProps: {
value: this.visible
@ -210,6 +212,10 @@ Modal.newInstance = properties => {
modal.$parent.width = props.width;
}
if ('closable' in props) {
modal.$parent.closable = props.closable;
}
if ('title' in props) {
modal.$parent.title = props.title;
}