1👍
✅
You’re attaching the listeners to the update:plusEmit
and update:minusEmit
on the ButtonsList
component. The problem is that component doesn’t emit those events. Event listeners have to be placed on the components that emit those events, in your case, they won’t bubble up to the parent.
You could either:
- Define the same events on the
ButtonList
component and emit them when the child emits their event like this:
<ButtonPlus @update:plusEmit="emit('update:plusEmits')" />
<ButtonMinus @update:minusEmit="emit('update:minusEmits')"/>
- Or do away with the subcomponents for the buttons and define them in the
ButtonsList
Source:stackexchange.com