added scrollable property to modal instance
This commit is contained in:
parent
5987219934
commit
a87da6896f
2 changed files with 16 additions and 2 deletions
|
@ -17,7 +17,7 @@ Modal.newInstance = properties => {
|
||||||
|
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
div.innerHTML = `
|
div.innerHTML = `
|
||||||
<Modal${props} :visible.sync="visible" :width="width">
|
<Modal${props} :visible.sync="visible" :width="width" :scrollable.sync="scrollable">
|
||||||
<div class="${prefixCls}">
|
<div class="${prefixCls}">
|
||||||
<div class="${prefixCls}-head">
|
<div class="${prefixCls}-head">
|
||||||
<div class="${prefixCls}-head-title">{{{ title }}}</div>
|
<div class="${prefixCls}-head-title">{{{ title }}}</div>
|
||||||
|
@ -49,7 +49,8 @@ Modal.newInstance = properties => {
|
||||||
cancelText: t('i.modal.cancelText'),
|
cancelText: t('i.modal.cancelText'),
|
||||||
showCancel: false,
|
showCancel: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
buttonLoading: false
|
buttonLoading: false,
|
||||||
|
scrollable: false
|
||||||
}),
|
}),
|
||||||
computed: {
|
computed: {
|
||||||
iconTypeCls () {
|
iconTypeCls () {
|
||||||
|
@ -153,6 +154,10 @@ Modal.newInstance = properties => {
|
||||||
modal.$parent.loading = props.loading;
|
modal.$parent.loading = props.loading;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('scrollable' in props) {
|
||||||
|
modal.$parent.scrollable = props.scrollable;
|
||||||
|
}
|
||||||
|
|
||||||
// notice when component destroy
|
// notice when component destroy
|
||||||
modal.$parent.onRemove = props.onRemove;
|
modal.$parent.onRemove = props.onRemove;
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
<p>对话框内容</p>
|
<p>对话框内容</p>
|
||||||
<i-button @click="scrollable = !scrollable">Toggle scrollable</i-button>
|
<i-button @click="scrollable = !scrollable">Toggle scrollable</i-button>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
<i-button @click="instance(true)">Create Instance Scrollable</i-button>
|
||||||
|
<i-button @click="instance(false)">Create Instance Non-scrollable</i-button>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
@ -34,6 +36,13 @@
|
||||||
},
|
},
|
||||||
cancel () {
|
cancel () {
|
||||||
this.$Message.info('点击了取消');
|
this.$Message.info('点击了取消');
|
||||||
|
},
|
||||||
|
instance (scrollable) {
|
||||||
|
this.$Modal.info({
|
||||||
|
title: 'test',
|
||||||
|
content: 'test',
|
||||||
|
scrollable: scrollable
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue