iview/test/routers/more.vue

50 lines
1.4 KiB
Vue
Raw Normal View History

<style>
body{
height: 2000px !important;
2016-12-26 14:50:39 +08:00
}
</style>
2016-09-09 14:29:19 +08:00
<template>
2017-01-13 15:35:38 +08:00
<i-button type="primary" @click="modal1 = true">显示对话框</i-button>
2017-02-05 22:58:34 -06:00
<i-button @click="scrollable = !scrollable">Toggle scrollable</i-button>
scrollable:{{scrollable}}
2017-01-13 15:35:38 +08:00
<Modal
:visible.sync="modal1"
title="普通的Modal对话框标题"
2017-02-05 22:58:34 -06:00
:scrollable="scrollable"
2017-01-13 15:35:38 +08:00
@on-ok="ok"
@on-cancel="cancel">
<p>对话框内容</p>
<p>对话框内容</p>
<p>对话框内容</p>
2017-02-05 22:58:34 -06:00
<i-button @click="scrollable = !scrollable">Toggle scrollable</i-button>
2017-01-13 15:35:38 +08:00
</Modal>
<i-button @click="instance(true)">Create Instance Scrollable</i-button>
<i-button @click="instance(false)">Create Instance Non-scrollable</i-button>
2016-09-09 14:29:19 +08:00
</template>
<script>
export default {
2017-01-13 15:35:38 +08:00
data () {
return {
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>