add closable props for $Modal https://github.com/iview/iview/issues/2362
This commit is contained in:
parent
54faea373a
commit
34324f28a6
2 changed files with 16 additions and 2 deletions
|
@ -18,6 +18,7 @@
|
|||
<i-option v-for="item in options" :value="item.value" :key="item.value">{{ item.label }}</i-option>
|
||||
</i-select>
|
||||
</Modal>
|
||||
<Button @click="showModelFunc">弹出</Button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -123,6 +124,13 @@
|
|||
item.loading = false;
|
||||
callback();
|
||||
}, 1000);
|
||||
},
|
||||
showModelFunc () {
|
||||
this.$Modal.success({
|
||||
title: 'haha',
|
||||
content: 'lsisdfsdfsdfs',
|
||||
closable: false
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue