2018-03-26 16:04:04 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class="md-example-child md-example-child-dialog md-example-child-dialog-0">
|
2018-04-24 22:47:39 +08:00
|
|
|
|
<md-button @click="basicDialog.open = true">基本</md-button>
|
|
|
|
|
|
<md-button @click="iconDialog.open = true">带图标</md-button>
|
2018-12-03 21:29:22 +08:00
|
|
|
|
<md-button @click="warnDialog.open = true">警示操作</md-button>
|
2018-04-24 22:47:39 +08:00
|
|
|
|
<md-button @click="actDialog.open = true">多操作</md-button>
|
2018-03-26 16:04:04 +08:00
|
|
|
|
|
|
|
|
|
|
<md-dialog
|
|
|
|
|
|
title="窗口标题"
|
|
|
|
|
|
:closable="true"
|
|
|
|
|
|
v-model="basicDialog.open"
|
|
|
|
|
|
:btns="basicDialog.btns"
|
|
|
|
|
|
>
|
|
|
|
|
|
人生的刺,就在这里,留恋着不肯快走的,偏是你所不留恋的东西。
|
|
|
|
|
|
</md-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
<md-dialog
|
2018-11-15 15:48:51 +08:00
|
|
|
|
icon="location"
|
2018-03-26 16:04:04 +08:00
|
|
|
|
:closable="true"
|
|
|
|
|
|
v-model="iconDialog.open"
|
|
|
|
|
|
:btns="iconDialog.btns"
|
|
|
|
|
|
>
|
|
|
|
|
|
围在城里的人想逃出来,城外的人想冲进去,对婚姻也罢,职业也罢,人生的愿望大都如此。
|
|
|
|
|
|
</md-dialog>
|
|
|
|
|
|
|
2018-12-03 21:29:22 +08:00
|
|
|
|
<md-dialog
|
|
|
|
|
|
title="警示操作"
|
|
|
|
|
|
:closable="false"
|
|
|
|
|
|
v-model="warnDialog.open"
|
|
|
|
|
|
:btns="warnDialog.btns"
|
|
|
|
|
|
>
|
|
|
|
|
|
或是因为习惯了孤独,我们渴望被爱;又或是害怕爱而不得,我们最后仍然选择孤独。
|
|
|
|
|
|
</md-dialog>
|
|
|
|
|
|
|
2018-03-26 16:04:04 +08:00
|
|
|
|
<md-dialog
|
|
|
|
|
|
title="窗口标题"
|
|
|
|
|
|
:closable="false"
|
2018-08-22 13:46:33 +08:00
|
|
|
|
layout="column"
|
2018-03-26 16:04:04 +08:00
|
|
|
|
v-model="actDialog.open"
|
|
|
|
|
|
:btns="actDialog.btns"
|
|
|
|
|
|
>
|
|
|
|
|
|
据说每个人需要一面镜子,可以常常自照,知道自己是个什么东西。不过,能自知的人根本不用照镜子;不自知的东西,照了镜子也没有用。
|
|
|
|
|
|
</md-dialog>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
2018-05-21 19:37:56 +08:00
|
|
|
|
<script>
import {Dialog, Button, Toast} from 'mand-mobile'
|
2018-03-26 16:04:04 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
name: 'dialog-demo',
|
|
|
|
|
|
components: {
|
|
|
|
|
|
[Dialog.name]: Dialog,
|
|
|
|
|
|
[Button.name]: Button,
|
|
|
|
|
|
},
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
|
|
|
|
|
basicDialog: {
|
|
|
|
|
|
open: false,
|
|
|
|
|
|
btns: [
|
2018-08-22 13:46:33 +08:00
|
|
|
|
{
|
|
|
|
|
|
text: '取消',
|
|
|
|
|
|
handler: this.onBasicCancel,
|
|
|
|
|
|
},
|
2018-03-26 16:04:04 +08:00
|
|
|
|
{
|
|
|
|
|
|
text: '确认操作',
|
|
|
|
|
|
handler: this.onBasicConfirm,
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
|
|
|
|
|
iconDialog: {
|
|
|
|
|
|
open: false,
|
|
|
|
|
|
btns: [
|
|
|
|
|
|
{
|
|
|
|
|
|
text: '确认操作',
|
|
|
|
|
|
handler: this.onIconConfirm,
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
2018-12-03 21:29:22 +08:00
|
|
|
|
warnDialog: {
|
|
|
|
|
|
open: false,
|
|
|
|
|
|
btns: [
|
|
|
|
|
|
{
|
|
|
|
|
|
text: '取消',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
text: '警示操作',
|
|
|
|
|
|
warning: true,
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
2018-03-26 16:04:04 +08:00
|
|
|
|
actDialog: {
|
|
|
|
|
|
open: false,
|
|
|
|
|
|
btns: [
|
|
|
|
|
|
{
|
2018-08-22 13:46:33 +08:00
|
|
|
|
text: '操作一',
|
|
|
|
|
|
type: 'danger',
|
|
|
|
|
|
handler: this.onActConfirm,
|
2018-03-26 16:04:04 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2018-08-22 13:46:33 +08:00
|
|
|
|
text: '操作二',
|
|
|
|
|
|
handler: this.onActConfirm,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
text: '操作三',
|
2018-03-26 16:04:04 +08:00
|
|
|
|
handler: this.onActConfirm,
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
onBasicConfirm() {
|
|
|
|
|
|
Toast({
|
|
|
|
|
|
content: '你点击了确认',
|
|
|
|
|
|
})
|
|
|
|
|
|
this.basicDialog.open = false
|
|
|
|
|
|
},
|
2018-08-22 13:46:33 +08:00
|
|
|
|
onBasicCancel() {
|
2018-03-26 16:04:04 +08:00
|
|
|
|
Toast({
|
|
|
|
|
|
content: '你点击了取消',
|
|
|
|
|
|
})
|
2018-08-22 13:46:33 +08:00
|
|
|
|
this.basicDialog.open = false
|
2018-03-26 16:04:04 +08:00
|
|
|
|
},
|
2018-08-22 13:46:33 +08:00
|
|
|
|
onIconConfirm() {
|
2018-03-26 16:04:04 +08:00
|
|
|
|
Toast({
|
|
|
|
|
|
content: '你点击了确认',
|
|
|
|
|
|
})
|
2018-08-22 13:46:33 +08:00
|
|
|
|
this.iconDialog.open = false
|
|
|
|
|
|
},
|
|
|
|
|
|
onActConfirm() {
|
2018-03-26 16:04:04 +08:00
|
|
|
|
this.actDialog.open = false
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
}
|
2018-05-21 19:37:56 +08:00
|
|
|
|
</script>
|