mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-09 13:07:37 +08:00
* Restructure hook files * Simplify app.js * Refactor hooks * Implement password toggle with JS commands
19 lines
298 B
JavaScript
19 lines
298 B
JavaScript
/**
|
|
* A hook used to scroll to the bottom of an element whenever it
|
|
* receives LV update.
|
|
*/
|
|
const ScrollOnUpdate = {
|
|
mounted() {
|
|
this.scroll();
|
|
},
|
|
|
|
updated() {
|
|
this.scroll();
|
|
},
|
|
|
|
scroll() {
|
|
this.el.scrollTop = this.el.scrollHeight;
|
|
},
|
|
};
|
|
|
|
export default ScrollOnUpdate;
|