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-option v-for="item in options" :value="item.value" :key="item.value">{{ item.label }}</i-option>
|
||||||
</i-select>
|
</i-select>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
<Button @click="showModelFunc">弹出</Button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
@ -123,6 +124,13 @@
|
||||||
item.loading = false;
|
item.loading = false;
|
||||||
callback();
|
callback();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
},
|
||||||
|
showModelFunc () {
|
||||||
|
this.$Modal.success({
|
||||||
|
title: 'haha',
|
||||||
|
content: 'lsisdfsdfsdfs',
|
||||||
|
closable: false
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,8 @@ Modal.newInstance = properties => {
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
buttonLoading: false,
|
buttonLoading: false,
|
||||||
scrollable: false
|
scrollable: false,
|
||||||
|
closable: true
|
||||||
}),
|
}),
|
||||||
render (h) {
|
render (h) {
|
||||||
let footerVNodes = [];
|
let footerVNodes = [];
|
||||||
|
@ -80,7 +81,8 @@ Modal.newInstance = properties => {
|
||||||
return h(Modal, {
|
return h(Modal, {
|
||||||
props: Object.assign({}, _props, {
|
props: Object.assign({}, _props, {
|
||||||
width: this.width,
|
width: this.width,
|
||||||
scrollable: this.scrollable
|
scrollable: this.scrollable,
|
||||||
|
closable: this.closable
|
||||||
}),
|
}),
|
||||||
domProps: {
|
domProps: {
|
||||||
value: this.visible
|
value: this.visible
|
||||||
|
@ -210,6 +212,10 @@ Modal.newInstance = properties => {
|
||||||
modal.$parent.width = props.width;
|
modal.$parent.width = props.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('closable' in props) {
|
||||||
|
modal.$parent.closable = props.closable;
|
||||||
|
}
|
||||||
|
|
||||||
if ('title' in props) {
|
if ('title' in props) {
|
||||||
modal.$parent.title = props.title;
|
modal.$parent.title = props.title;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue