mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
37 lines
765 B
Markdown
37 lines
765 B
Markdown
# 不可关闭
|
|
通知可以不能被关闭
|
|
```html
|
|
<n-button @click="handleClick">
|
|
不能关闭
|
|
</n-button>
|
|
```
|
|
```js
|
|
export default {
|
|
inject: ['notification'],
|
|
methods: {
|
|
handleClick () {
|
|
const notification = this.notification
|
|
notification.create({
|
|
title: '你能关掉我吗?',
|
|
duration: 2000,
|
|
closable: false,
|
|
onAfterLeave: () => {
|
|
notification.create({
|
|
title: `哈哈哈哈!`,
|
|
duration: 2000,
|
|
closable: false,
|
|
onAfterLeave: () => {
|
|
notification.create({
|
|
title: `你不能`,
|
|
duration: 2000,
|
|
closable: false
|
|
})
|
|
}
|
|
})
|
|
}
|
|
})
|
|
}
|
|
}
|
|
}
|
|
```
|