You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
738 B
39 lines
738 B
6 years ago
|
|
||
|
<cn>
|
||
|
#### 更新消息内容
|
||
|
可以通过唯一的 key 来更新内容。
|
||
|
</cn>
|
||
|
|
||
|
<us>
|
||
|
#### Update Message Content
|
||
|
Update content with unique key.
|
||
|
</us>
|
||
|
|
||
|
```html
|
||
|
<template>
|
||
|
<a-button type="primary" @click="openNotification">Open the notification box</a-button>
|
||
|
</template>
|
||
|
<script>
|
||
|
const key = 'updatable'
|
||
|
export default {
|
||
|
methods: {
|
||
|
openNotification () {
|
||
|
this.$notification.open({
|
||
|
key,
|
||
|
message: 'Notification Title',
|
||
|
description: 'description.',
|
||
|
});
|
||
|
setTimeout(() => {
|
||
|
this.$notification.open({
|
||
|
key,
|
||
|
message: 'New Title',
|
||
|
description: 'New description.',
|
||
|
});
|
||
|
}, 1000);
|
||
|
},
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
```
|
||
|
|