[Vuejs]-Vue3 Set List Item Different for Every Loop

0👍

you can emit multiple values by using an object for example:

$emit('chosen', { chosen:true, configData:item})

and then in your component use one callback to call both activeLevel++ and configData

<component
  :list="levels"
  @chosen="handleCallback"
  :active-level="activeLevel"
  :is="BaseLevel"
></component>

handleCallback:

function handleCallback(data){
   configData(data.configData);
   activeLevel++;
}

I hope you get the idea if you’re using one click event use one callback handler and put your function calls there.

Leave a comment