I am currently utilizing the vue-js-toggle-button
library.
While I understand that I can access the value inside the name using $refs, the issue arises as I have 3 toggle buttons and cannot set a Ref because I want to retrieve the name value dynamically in "payload"...
In other buttons, I have used
@click="Myfucntion($event.target)"
However, $event.target
does not seem to work with @change in this specific library.
<toggle-button
color="rgba(9, 90, 6, 1)"
@change="SaveConfigFinalSemana($event)"
name="email"
ref='email'
:labels="{checked: 'Sim', unchecked: 'Não'}"
/>
<toggle-button
color="rgba(9, 90, 6, 1)"
@change="SaveConfigFinalSemana($event)"
name="sms"
ref='sms'
:labels="{checked: 'Sim', unchecked: 'Não'}"
/>
<toggle-button
color="rgba(9, 90, 6, 1)"
@change="SaveConfigFinalSemana($event)"
name="wpp"
ref='wpp'
:labels="{checked: 'Sim', unchecked: 'Não'}"
/>
const payload = {
disparos_fds: elemento.value,
tipo_envio: this.$refs.wpp.name,
client_uuid: user.company_uuid
};