[Vuejs]-Listen when #content area is longer than window height (native or Vue.js)

0👍

Well it’s not that easy. Since I don’t know Vue.js I can only tell you about native JS solutions – there are two ways:
1) If the content changes only on some particular actions eg. user editing textarea, then you can attach your height checker function to the corresponding event(s).
2) The more general solution would be to set function which will watch for changes continuously like setInterval or requestAnimationFrame.

First example is better from performance point of view but might be harder to implement, it depends on how many things can change size of your content.

Leave a comment