mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-02-22 05:48:31 +08:00
21 lines
323 B
JavaScript
21 lines
323 B
JavaScript
import { scrollToEnd } from "../lib/utils";
|
|
|
|
/**
|
|
* 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() {
|
|
scrollToEnd(this.el);
|
|
},
|
|
};
|
|
|
|
export default ScrollOnUpdate;
|