naive-ui/demo/documentation/components/notification/enUS/scrollable.md

22 lines
789 B
Markdown
Raw Normal View History

2019-12-08 20:47:14 +08:00
# Scrollable
2020-02-04 14:10:35 +08:00
If there are too many notifications, you can make them scrollable by setting `$NNotification.scrollable = true`. However, in that case they will overlay a bit more area than them look, which will block some mouse events near notifications. If you don't want the feature, simply not set it.
2019-12-08 20:47:14 +08:00
Change the property will cause all existing notifications to be cleaned, so please make sure you change this property at proper time.
```html
2020-02-04 14:10:35 +08:00
<n-button @click="handleClick(true)">Scrollable(Open some notifications after click)</n-button>
<n-button @click="handleClick(false)">Unscrollable</n-button>
2019-12-08 20:47:14 +08:00
```
```js
export default {
methods: {
handleClick (scrollable) {
this.$NNotification.scrollable = scrollable
}
}
}
```
```css
.n-button {
margin: 0 12px 8px 0;
}
```