iview/examples/routers/more.vue

68 lines
1.8 KiB
Vue
Raw Normal View History

<style lang="less">
.vertical-center-modal{
display: flex;
align-items: center;
justify-content: center;
.ivu-modal{
top: 0;
}
2016-12-26 14:50:39 +08:00
}
2017-02-22 21:45:53 -06:00
.placeholder {
min-height: 2000px;
width: 1px;
}
2016-12-26 14:50:39 +08:00
</style>
2016-09-09 14:29:19 +08:00
<template>
<i-button @click="modal9 = true">距离顶部 20px</i-button>
2017-01-13 15:35:38 +08:00
<Modal
title="对话框标题"
:visible.sync="modal9"
:style="{top: '20px'}">
<p>对话框内容</p>
<p>对话框内容</p>
<p>对话框内容</p>
</Modal>
<i-button @click="modal10 = true">垂直居中</i-button>
2017-01-13 15:35:38 +08:00
<Modal
title="对话框标题"
:visible.sync="modal10"
class-name="vertical-center-modal">
2017-01-13 15:35:38 +08:00
<p>对话框内容</p>
<p>对话框内容</p>
<p>对话框内容</p>
</Modal>
<i-button @click="instance(true)">Create Instance Scrollable</i-button>
<i-button @click="instance(false)">Create Instance Non-scrollable</i-button>
2017-02-22 21:45:53 -06:00
<div class="placeholder"></div>
2016-09-09 14:29:19 +08:00
</template>
<script>
export default {
2017-01-13 15:35:38 +08:00
data () {
return {
modal9: false,
modal10: false,
modal1: false,
2017-02-05 22:58:34 -06:00
scrollable: false
2017-01-13 15:35:38 +08:00
}
},
methods: {
ok () {
this.$nextTick(() => this.modal1 = true);
this.$Message.info('点击了确定');
},
cancel () {
this.$Message.info('点击了取消');
},
instance (scrollable) {
this.$Modal.info({
title: 'test',
content: 'test',
scrollable: scrollable
});
2017-01-13 15:35:38 +08:00
}
}
2016-09-09 14:29:19 +08:00
}
2016-11-09 18:23:17 +08:00
</script>