Reputation: 47
Is it possible to watch for changes on components element clientWidth (this.$el.clientWidth)? Something like:
this.$watch(
() => {
return this.$el.clientWidth;
},
(newWidth, oldWidth) => {
console.log(newWidth);
}
)
Upvotes: 4
Views: 3301
Reputation: 11
I am investigating the same problem. I think the solution dependent on the HTML lifecycle is effective in some cases. I am pleased if my solution at the present stage will serve you.
mousemove (e) {
this.clientWidth = this.$el.clientWidth
}
Upvotes: 1