# Scroll
You can easily make log scroll to top or bottom. Also you can make the scroll action silent (don't trigger events of Log in this scroll action).
```html
Scroll To Bottom
Scroll To Bottom (silent)
Scroll To Top
Scroll To Top (silent)
```
```js
function log() {
const l = []
for (let i = 0; i < 10; ++i) {
l.push(Math.random().toString(16))
}
return l.join("\n") + "\n"
}
export default {
data() {
return {
loading: false,
log: log()
}
},
methods: {
clear() {
this.log = ""
},
handleRequireMore(from) {
this.$NMessage.info("Require More from " + from)
if (this.loading) return
this.loading = true
setTimeout(() => {
if (from === "top") {
this.log = log() + this.log
} else if (from === "bottom") {
this.log = this.log + log()
}
this.loading = false
}, 1000)
},
handleReachTop() {
this.$NMessage.info("Reach Top")
},
handleReachBottom() {
this.$NMessage.info("Reach Bottom")
},
scrollTo(to, dismissEvent = false) {
if (to === "bottom") {
this.$refs.log.scrollToBottom(dismissEvent)
} else {
this.$refs.log.scrollToTop(dismissEvent)
}
}
}
}
```
```css
.n-button-group {
margin-bottom: 12px;
}
```