ant-design-vue/components/modal/demo/basic.md

47 lines
632 B
Markdown
Raw Normal View History

2018-03-06 11:14:41 +00:00
<cn>
#### 基本
第一个对话框。
</cn>
<us>
#### Basic
Basic modal.
</us>
```html
<template>
<div>
<a-button type="primary" @click="showModal">Open</a-button>
<a-modal
title="Basic Modal"
2018-03-07 13:36:15 +00:00
v-model="visible"
2018-03-06 11:14:41 +00:00
@ok="handleOk"
>
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
</a-modal>
</div>
</template>
<script>
export default {
data() {
return {
visible: false,
}
},
methods: {
showModal() {
this.visible = true
},
handleOk(e) {
console.log(e);
this.visible = false
},
}
}
</script>
```