I need to create several <multiselects>. In doing this I must identify the clicked list in some way with the purpose of passing this name to the method that makes push into the list.
By example, given these lists:
List A | List B | List C |
--------------------------------------------------------------|
{tag:xz , code:1} |{tag:pkrte,code:1} |{tag:Item1,code:1 } |
{tag:ac , code:2}, |{tag:bnetf,code:2},|{tag:Item2,code:2 },|
{tag:bz , code:3}, |{tag:erert,code:3},|{tag:Item3,code:3 },|
{tag:hy , code:4}, |{tag:kjerx,code:4},| |
{tag:yjer , code:5}, | | |
I have defined this multiselects:
(simplified code to exemplify)
<multiselect |<multiselect |<multiselect
v-model="SelAlergies1" | v-model="SelAlergies2" | v-model="SelAlergies3"
:height="300" | :height="300" | :height="300"
:options="ListA" | :options="ListB" | :options="ListC"
:multiple="true" | :multiple="true" | :multiple="true"
:taggable="true" | :taggable="true" | :taggable="true"
placeholder="Alergies1"| placeholder="Alergies2"| placeholder="Alergies3"
@tag="addTag('ListA')" | @tag="addTag('ListB')" | @tag="addTag('ListC')"
label="Tag" | label="Tag" | label="Tag"
track-by="Code" > | track-by="Code"> | track-by="Code" >
</multiselect> |</multiselect> |</multiselect>
I'm trying to send the list as a parameter in the event
@tag="addTag('ListA')"
How can I pass as a parameter the name of the list (ListA, ListB. ListC )to indicate to the method which list should push?
addTag(newTag, listName ) {
const tag = {
Etiqueta: newTag,
};
this.listName.push(tag);
this.listName.push(tag);`
},
How can I achieve this?
SelAlergiasMedicamentos, yourv-modelvariable?