2018-03-07 13:36:15 +00:00
|
|
|
|
|
|
|
<cn>
|
|
|
|
#### 信息提示
|
|
|
|
各种类型的信息提示,只提供一个按钮用于关闭。
|
|
|
|
</cn>
|
|
|
|
|
|
|
|
<us>
|
|
|
|
#### Information modal dialog
|
|
|
|
In the various types of information modal dialog, only one button to close dialog is provided.
|
|
|
|
</us>
|
|
|
|
|
|
|
|
```html
|
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<a-button @click="info">Info</a-button>
|
|
|
|
<a-button @click="success">Success</a-button>
|
|
|
|
<a-button @click="error">Error</a-button>
|
|
|
|
<a-button @click="warning">Warning</a-button>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
<script>
|
|
|
|
import { Modal } from 'antd'
|
|
|
|
export default {
|
|
|
|
methods: {
|
|
|
|
info() {
|
|
|
|
const h = this.$createElement
|
2018-04-08 13:17:20 +00:00
|
|
|
this.$info({
|
2018-03-07 13:36:15 +00:00
|
|
|
title: 'This is a notification message',
|
|
|
|
content: h('div',{}, [
|
|
|
|
h('p', 'some messages...some messages...'),
|
|
|
|
h('p', 'some messages...some messages...'),
|
|
|
|
]),
|
|
|
|
onOk() {},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
success() {
|
2018-04-08 13:17:20 +00:00
|
|
|
this.$success({
|
2018-03-07 13:36:15 +00:00
|
|
|
title: 'This is a success message',
|
|
|
|
content: ( // JSX support
|
|
|
|
<div>
|
|
|
|
<p>some messages...some messages...</p>
|
|
|
|
<p>some messages...some messages...</p>
|
|
|
|
</div>
|
|
|
|
),
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
error() {
|
2018-04-08 13:17:20 +00:00
|
|
|
this.$error({
|
2018-03-07 13:36:15 +00:00
|
|
|
title: 'This is an error message',
|
|
|
|
content: 'some messages...some messages...',
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
warning() {
|
2018-04-08 13:17:20 +00:00
|
|
|
this.$warning({
|
2018-03-07 13:36:15 +00:00
|
|
|
title: 'This is a warning message',
|
|
|
|
content: 'some messages...some messages...',
|
|
|
|
});
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
```
|
|
|
|
|