Created
June 17, 2016 05:46
-
-
Save hirokiky/1282c7dee63241a7b7e6e81d44224796 to your computer and use it in GitHub Desktop.
Vue.js directive to scroll bottom when the applied value updated.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(Vue) { | |
Vue.directive('auto-bottom', { | |
update: function() { | |
this.el.scrollTop = this.el.scrollHeight; | |
} | |
}) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you should write down, where this module can be used.