I'm trying to use computed or watch to detect body's scrollHeight change, but it doesn't work.
Here is my code:
computed: {
bodyScrollHeight() {
return document.body.scrollHeight;
}
},
watch:{
bodyScrollHeight: function(newValue) {
this.watchScrollHeight = newValue;
this.myFunction(newValue);
}
},
CodePen Link: https://codepen.io/chhoher/pen/wvMoLOg