[Vuejs]-Vue.JS – How to have a button perform two separate actions on the same parent element?

2👍

I assume <build-item-edit> is your own component so just add a callback event to it i.e

<build-item-edit @doOnEmit="someFunctionOnTheParent" :buildNumber="buildNumber" :itemNumber="editItemNumber"/>

Then on the parent component, define the method someFunctionOnTheParent and run the code that does your UI stuff.

Then in the build-item-edit component, before you emit the value, call this.$emit('doOnEmit')

Leave a comment