iview/examples/routers/modal.vue

35 lines
883 B
Vue
Raw Normal View History

2017-03-09 18:31:47 +08:00
<template>
<div>
2017-03-31 09:26:59 +08:00
<Button type="primary" @click="modal1 = true">显示对话框</Button>
2017-03-31 09:26:59 +08:00
<Modal
v-model="modal1"
:title="title"
2017-03-31 09:26:59 +08:00
@on-ok="ok"
:mask-closable="false"
2017-03-31 09:26:59 +08:00
@on-cancel="cancel">
<p><Button type="ghost" @click="title = '这是标题'">设置标题</Button> {{title}}</p>
2017-03-31 09:26:59 +08:00
<p>对话框内容</p>
<p>对话框内容</p>
</Modal>
2017-03-09 18:31:47 +08:00
</div>
</template>
<script>
export default {
2017-03-31 09:26:59 +08:00
data () {
return {
modal1: true,
title:''
2017-03-31 09:26:59 +08:00
}
},
2017-03-09 18:31:47 +08:00
methods: {
2017-03-31 09:26:59 +08:00
ok () {
this.$Message.info('点击了确定');
},
2017-03-31 09:26:59 +08:00
cancel () {
this.$Message.info('点击了取消');
2017-03-09 18:31:47 +08:00
}
}
}
</script>