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

32 lines
720 B
Markdown
Raw Normal View History

2018-02-06 07:21:13 +00:00
<cn>
#### 基本
最简单的用法4.5 秒后自动关闭。
</cn>
<us>
#### Basic
The simplest usage that close the notification box after 4.5s.
</us>
2019-10-09 10:32:23 +00:00
```tpl
2018-02-06 07:21:13 +00:00
<template>
<a-button type="primary" @click="openNotification">Open the notification box</a-button>
</template>
<script>
export default {
methods: {
2019-09-28 12:45:07 +00:00
openNotification() {
2018-04-08 13:17:20 +00:00
this.$notification.open({
2018-02-06 07:21:13 +00:00
message: 'Notification Title',
2019-09-28 12:45:07 +00:00
description:
'This is the content of the notification. This is the content of the notification. This is the content of the notification.',
2019-01-05 02:55:03 +00:00
onClick: () => {
console.log('Notification Clicked!');
},
2018-02-06 07:21:13 +00:00
});
},
2019-09-28 12:45:07 +00:00
},
};
2018-02-06 07:21:13 +00:00
</script>
```