2.5.11 (and earlier versions)
https://jsfiddle.net/xb4172g8/
{ ...this.$listeners } with an empty objectVue should re-render only the component whose props has changed.
Using $listeners in component's render function causes the component to be rendered whenever its parent is updated even though his props hasn't changed.
At the moment we always set $listeners when updating the parent, so yes, it triggers children updates if the use $listeners in the render function. Maybe this could be prevented by making sure the listeners have been updated before setting $listeners (https://github.com/vuejs/vue/blob/dev/src/core/instance/lifecycle.js#L243)
Unfortunately even if we do a shallowEqual check before setting $listeners, your specific example would still re-render because your @input listeners are created as a new anonymous function for each render, so technically they are different. This is similar to passing down a different anonymous function as prop on every render.
Has there been made any plans to implement such a check?
Is there any workaround for this issue? I had to manually set up all listeners on a transparent wrapper, but it doesn't feel right. Actually, how is it going to work in Vue 3?
is only resolve this problem like vuetify?
Most helpful comment
Unfortunately even if we do a shallowEqual check before setting
$listeners, your specific example would still re-render because your@inputlisteners are created as a new anonymous function for each render, so technically they are different. This is similar to passing down a different anonymous function as prop on every render.